From 5207c665f575fc3131b0af77f482af5a6da154e4 Mon Sep 17 00:00:00 2001 From: nott Date: Mon, 12 Oct 2009 18:32:55 +0000 Subject: [PATCH] Fix get_nim_attr_val git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4357 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/aixinstall.pm | 36 ++++++++-------------- 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/aixinstall.pm b/xCAT-server/lib/xcat/plugins/aixinstall.pm index ca033204f..fdc746c0a 100644 --- a/xCAT-server/lib/xcat/plugins/aixinstall.pm +++ b/xCAT-server/lib/xcat/plugins/aixinstall.pm @@ -3002,32 +3002,20 @@ sub get_nim_attr_val } chomp $target; - my $cmd = "/usr/sbin/lsnim -l $resname 2>/dev/null"; - my $nout = &xcmd($callback, "xdsh", $target, $cmd, 1); - my @result = @$nout; - if ($::RUNCMD_RC != 0) - { + my $cmd = "/usr/sbin/lsnim -a location -Z $resname 2>/dev/null"; + my $nout = &xcmd($callback, "xdsh", $target, $cmd, 0); + if ($::RUNCMD_RC != 0) + { my $rsp; - push @{$rsp->{data}}, "Could not run lsnim command: \'$cmd\'.\n"; - xCAT::MsgUtils->message("E", $rsp, $callback); - return 1; - } - - foreach my $line (@result){ - my ($junk, $out); - if (grep(/:/, $line)) { # strip off node name if used xdsh - ($junk, $out) = split(/:/, $line); - } - my ($attr,$value) = split('\=', $out); - chomp $attr; - $attr =~ s/\s*//g; # remove blanks - chomp $value; - $value =~ s/^\s*//; - if ($attr eq $attrname) { - return $value; - } + push @{$rsp->{data}}, "Could not run lsnim command: \'$cmd\'.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback); + return undef; } - return undef; + + my ($junk, $junk, $junk, $loc) = split(/:/, $nout); + chomp $loc; + + return $loc; }