2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 17:23:08 +00:00

refine the message in rspconfig sshcfg

This commit is contained in:
immarvin 2017-10-18 02:46:56 -04:00
parent 1b1e2267a8
commit 2e63607c8c
2 changed files with 13 additions and 13 deletions

View File

@ -466,7 +466,7 @@ sub testkeys
return 0;
} else {
my $rsp = {};
$rsp->{error}->[0] = $msg;
$rsp->{error}->[0] = "Testing the ssh connection to $nodes failed:".$msg;
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
return 1;
}
@ -598,7 +598,7 @@ sub sendnodeskeys
$rc = 0;
} else {
my $rsp = {};
$rsp->{error}->[0] = "mkdir:$node has error,$msg";
$rsp->{error}->[0] = "Failed to run \"/bin/mkdir -p /tmp/$to_userid/.ssh\" on $node: $msg";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
$rc = 1;
}
@ -686,7 +686,7 @@ sub sendnodeskeys
$rc = 0;
} else {
my $rsp = {};
$rsp->{error}->[0] = "copykeys:$node has error,$msg";
$rsp->{error}->[0] = "Failed to copy ssh credentials and helper script to $node: $msg";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
$rc = 1;
}
@ -771,7 +771,7 @@ sub sendnodeskeys
$rc = 0;
} else {
my $rsp = {};
$rsp->{error}->[0] = "copy.sh:$node has error,$msg";
$rsp->{error}->[0] = "Failed to apply the ssh keys on $node:$msg";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
$rc = 1;
}

View File

@ -1963,15 +1963,15 @@ rmdir \"/tmp/$userid\" \n";
my $rc=xCAT::RemoteShellExp->remoteshellexp("s",$callback,"/usr/bin/ssh",$bmcip,10);
if ($rc) {
xCAT::SvrUtils::sendmsg("Error copying ssh keys to $bmcip\n", $callback, $node);
}
#check whether the ssh keys has been sent successfully
$rc=xCAT::RemoteShellExp->remoteshellexp("t",$callback,"/usr/bin/ssh",$bmcip,10);
if ($rc) {
xCAT::SvrUtils::sendmsg("Error copying ssh keys to $bmcip Rerun rspconfig command.", $callback, $node);
}
else {
xCAT::SvrUtils::sendmsg("ssh keys copied to $bmcip", $callback, $node);
}else{
#check whether the ssh keys has been sent successfully
$rc=xCAT::RemoteShellExp->remoteshellexp("t",$callback,"/usr/bin/ssh",$bmcip,10);
if ($rc) {
xCAT::SvrUtils::sendmsg("Testing the ssh connection to $bmcip failed. Please rerun rspconfig command.", $callback, $node);
}
else {
xCAT::SvrUtils::sendmsg("ssh keys copied to $bmcip", $callback, $node);
}
}
#restore env variables