From 88a068d6f57529daffe4bca5bfe74685a4e9afd8 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 21 Sep 2006 12:42:48 +0000 Subject: if authentication failed with "No host for this id", just transparently register the host again (eg: when host was deleted through the web interface) --- mdkonline | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mdkonline') diff --git a/mdkonline b/mdkonline index c8915cf4..f0b1ae3d 100755 --- a/mdkonline +++ b/mdkonline @@ -167,7 +167,15 @@ my $wiz = data => [ { } ], complete => sub { my $err = send_conf_via_soap($login, $password, $boxname, $descboxname, $country); + # if authentication failed with "No host for this id", just transparently register the host again: + # (eg: when host was deleted through the web interface) if ($err ne 'OK') { + if ($err =~ /No host for this id/) { + log::explanations("registring again the host because the id is lost (deleted through the web interface?"); + substInFile { undef $_ if /HOST_ID|HOST_NAME/ } '/etc/sysconfig/mdkonline'; + $err = send_conf_via_soap($login, $password, $boxname, $descboxname, $country); + } + return $err eq 'OK'; $in->ask_warn(N("Error"), N("Connection problem") . "\n\n" . N("Problem occurs when uploading files, please try again") . "\n\n" . $err); return 1; } -- cgit v1.2.1