diff --git a/xCAT-server/lib/xcat/plugins/snmove.pm b/xCAT-server/lib/xcat/plugins/snmove.pm index d7de746e1..149261ee8 100644 --- a/xCAT-server/lib/xcat/plugins/snmove.pm +++ b/xCAT-server/lib/xcat/plugins/snmove.pm @@ -416,13 +416,8 @@ sub process_request ) ) { - - # get the short hostname - my $xcatmaster = xCAT::NetworkUtils->gethostname($IP); - $xcatmaster =~ s/\..*//; - # add the value to the hash - $newxcatmaster{$node} = $xcatmaster; + $newxcatmaster{$node} = $IP; last; } } @@ -1342,9 +1337,11 @@ sub process_request $sub_req, -1, 1 ); - if ($::RUNCMD_RC != 0) + if (($::RUNCMD_RC != 0) && + !grep(/ File exists/,@$ret) ) # ignore already set error { my $rsp; + $rsp->{data} = $ret; push @{$rsp->{data}}, $ret; push @{$rsp->{data}}, "Could not set default route.\n"; xCAT::MsgUtils->message("E", $rsp, $callback); @@ -1559,27 +1556,42 @@ sub process_request xCAT::MsgUtils->message("I", $rsp, $callback); foreach my $scripts (keys(%$pos_hash)) { - my $pos_nodes = $pos_hash->{$scripts}; + # need to run updatenode -s first as a separate call + # before running updatenode -P. The flags cannot be run together. my $ret = xCAT::Utils->runxcmd( { command => ['updatenode'], node => $pos_nodes, - arg => ["-P", "$scripts", "-s"], + arg => ["-s"], }, $sub_req, -1, 1 ); if ($::RUNCMD_RC != 0) { $error++; - } - my $rsp; $rsp->{data} = $ret; xCAT::MsgUtils->message("I", $rsp, $callback); + + $ret = + xCAT::Utils->runxcmd( + { + command => ['updatenode'], + node => $pos_nodes, + arg => ["-P", "$scripts"], + }, + $sub_req, -1, 1 + ); + if ($::RUNCMD_RC != 0) + { + $error++; + } + $rsp->{data} = $ret; + xCAT::MsgUtils->message("I", $rsp, $callback); } } # end -for both AIX and Linux systems