From ecec67cfca00f9678c6b3b2a5f91665910075562 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 13 Aug 2018 10:53:22 -0400 Subject: [PATCH] Stop rinstall processing if runimage is invalid (#5447) --- xCAT-server/lib/xcat/plugins/destiny.pm | 2 +- xCAT-server/lib/xcat/plugins/rinstall.pm | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index b79f2b876..ee0f207c8 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -603,7 +603,7 @@ sub setdestiny { my $cmd = "wget --spider --timeout 3 --tries=1 $path"; my @output = xCAT::Utils->runcmd("$cmd", -1); unless (grep /^Remote file exists/, @output) { - $callback->({ error => ["Cannot get $path with wget. Could you confirm it's downloadable by wget?"], errorcode => [1], errorabort => [1]}); + $callback->({ error => ["Cannot wget $path. Verify it's downloadable."], errorcode => [1], errorabort => [1]}); return; } } else { diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index c1c942669..b71a14902 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -365,6 +365,14 @@ sub rinstall { xCAT::MsgUtils->message("E", $rsp, $callback); return 1; } + if ($line =~ /Cannot wget/) { + # If nodeset returns error that runimage can not be downloaded by wget, + # display the error from nodeset (if not alredy displayed by VERBOSE above), stop processing and return. + unless ($VERBOSE) { + xCAT::MsgUtils->message("I", $rsp, $callback); + } + return 1; + } xCAT::MsgUtils->message("I", $rsp, $callback); }