defect 4147 fix snmove route add and updatenode calls

This commit is contained in:
mellor 2014-06-10 16:46:46 -04:00
parent f5851bc826
commit a96a4aceb5

View File

@ -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