Cleaned up how smcli calls are logged in syslog.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15597 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
5777cd4dd7
commit
bd38609ba1
@ -658,16 +658,18 @@ sub purgeReader {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to purge reader
|
||||
my $cmd = '\"' . "CMD=PURGE $userId RDR ALL" . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("purgeReader- ssh $user\@$hcp $sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Purge reader using CP
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp purge $userId rdr all"`;
|
||||
xCAT::zvmUtils->printSyslog("purgeReader- ssh -o ConnectTimeout=5 $user\@$hcp $sudo /sbin/vmcp purge $userId rdr all");
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp purge $userId rdr all");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
@ -699,16 +701,18 @@ sub sendCPCmd {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to send command
|
||||
$cmd = '\"' . "CMD=SEND CP $userId " . uc($cmd) . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("sendCPCmd- ssh $user\@$hcp $sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Send CP command to given user
|
||||
$out = `ssh $user\@$hcp "$sudo /sbin/vmcp send cp $userId $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("sendCPCmd- ssh $user\@$hcp $sudo /sbin/vmcp send cp $userId $cmd");
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp send cp $userId $cmd");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
@ -315,6 +315,9 @@ sub printSyslog {
|
||||
# Get inputs
|
||||
my ( $class, $str ) = @_;
|
||||
|
||||
# Prepend where this message came from
|
||||
$str = $class . " " . $str;
|
||||
|
||||
# Print string
|
||||
xCAT::MsgUtils->message( "S", $str );
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user