2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Workaround different IPv6 syntax for asu/onecli

This commit is contained in:
Jarrod Johnson
2017-08-04 11:06:18 -04:00
parent caba9130bd
commit 8489de8dba

View File

@@ -23,9 +23,13 @@ use Getopt::Long;
use POSIX qw(:signal_h :errno_h :sys_wait_h);
use Thread qw(yield);
$::onecli = 0;
if ($iam =~ /pasu/) {
$::utilcmd = '/opt/lenovo/onecli/asu';
$::onecli = 1;
if (!-x $::utilcmd) {
$::onecli = 0;
$::utilcmd = '/opt/lenovo/toolscenter/asu/asu64';
}
if (!-x $::utilcmd) {
@@ -240,6 +244,9 @@ sub utilnode {
} else {
foreach my $a (@_) { $args .= ' ' . xCAT::Utils->quote($a); }
}
if ($::onecli and $bmc =~ /:/) {
$bmc = "[$bmc]";
}
my $cmd = "$::utilcmd $args --host '$bmc' --user '$username' --password '$passwd' 2>&1 |";
if ($::VERBOSE) { print "forking $cmd\n"; }
my $pid = open($$out, $cmd);