summaryrefslogtreecommitdiffstats
path: root/install/ui/host.js
diff options
context:
space:
mode:
authorPetr Voborník <pvoborni@redhat.com>2012-02-23 11:26:05 +0100
committerPetr Vobornik <pvoborni@redhat.com>2012-02-29 12:59:13 +0100
commitcf60e7e71e800bbbe5eb42039a375782af17c379 (patch)
treef22167fada58ed5bc75b7f1dfc73b7efc298ebff /install/ui/host.js
parent525bf04da56829ac2b7b6e086a7a2d965727ce02 (diff)
downloadfreeipa.git-cf60e7e71e800bbbe5eb42039a375782af17c379.tar.gz
freeipa.git-cf60e7e71e800bbbe5eb42039a375782af17c379.tar.xz
freeipa.git-cf60e7e71e800bbbe5eb42039a375782af17c379.zip
Fixed DNS record add handling of 4304 error
Fixed hanling of 4304 error in DNS record add. Code which handled this error in host-add was generalized and moved to IPA. DNS record add both in adder dialog and dns record table are using this generalized version. https://fedorahosted.org/freeipa/ticket/2349
Diffstat (limited to 'install/ui/host.js')
-rw-r--r--install/ui/host.js33
1 files changed, 2 insertions, 31 deletions
diff --git a/install/ui/host.js b/install/ui/host.js
index f2b84529..6f9e3577 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -347,7 +347,7 @@ IPA.widget_factories['host_fqdn'] = IPA.host_fqdn_widget;
IPA.host_adder_dialog = function(spec) {
spec = spec || {};
- spec.retry = typeof spec.retry !== 'undefined' ? spec.retry : false;
+ spec.retry = spec.retry !== undefined ? spec.retry : false;
var that = IPA.entity_adder_dialog(spec);
@@ -356,36 +356,7 @@ IPA.host_adder_dialog = function(spec) {
that.container.addClass('host-adder-dialog');
};
- that.on_error = function(xhr, text_status, error_thrown) {
- var ajax = this;
- var command = that.command;
- var data = error_thrown.data;
- var dialog = null;
-
- if(data && data.error && data.error.code === 4304) {
- dialog = IPA.message_dialog({
- message: data.error.message,
- title: spec.title,
- on_ok: function() {
- data.result = {
- result: {
- fqdn: command.args[0]
- }
- };
- command.on_success.call(ajax, data, text_status, xhr);
- }
- });
- } else {
- dialog = IPA.error_dialog({
- xhr: xhr,
- text_status: text_status,
- error_thrown: error_thrown,
- command: command
- });
- }
-
- dialog.open(that.container);
- };
+ that.on_error = IPA.create_4304_error_handler(that);
return that;
};