From 8489de8dba61fdb6446b0c196a7250f1e7a9fa46 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 4 Aug 2017 11:06:18 -0400 Subject: [PATCH] Workaround different IPv6 syntax for asu/onecli --- xCAT-client/bin/pasu | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xCAT-client/bin/pasu b/xCAT-client/bin/pasu index ccda294db..4b5e75deb 100755 --- a/xCAT-client/bin/pasu +++ b/xCAT-client/bin/pasu @@ -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);