From 7b76695826f84c16100d3d06c8486ede92828da4 Mon Sep 17 00:00:00 2001 From: ligc Date: Mon, 30 Nov 2009 09:40:53 +0000 Subject: [PATCH] fix several issues working with NIM Prime git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4692 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/InstUtils.pm | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index be89224fb..bea174219 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -267,8 +267,14 @@ sub get_nim_attr_val return undef; } - my ($junk, $junk, $junk, $loc) = split(/:/, $nout); - chomp $loc; + # The command output may have the xdsh prefix "target:" + #my ($junk, $junk, $junk, $loc) = split(/:/, $nout); + #chomp $loc; + my $loc; + if ($nout =~ /.*$resname:(.*):$/) + { + $loc = $1; + } return $loc; } @@ -388,22 +394,24 @@ sub readBNDfile xCAT::InstUtils->get_nim_attr_val($BNDname, 'location', $callback, $nimprime, $sub_req); - # open the file - unless (open(BNDFILE, "<$bnd_file_name")) - { - return (1); + # The boundle file may be on nimprime + my $ccmd = qq~cat $bnd_file_name~; + my $output=xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", $nimprime, $ccmd, 0); + if ($::RUNCMD_RC != 0) { + my $rsp; + push @{$rsp->{data}}, "Command: $ccmd failed."; + xCAT::MsgUtils->message("E", $rsp, $callback); } # get the names of the packages - while (my $l = ) + #$output =~ s/$nimprime:\s+//g; + foreach my $line (split(/\n/, $output)) { - - chomp $l; - + #May include xdsh prefix $nimprime: + $line =~ s/$nimprime:\s+//; # skip blank and comment lines - next if ($l =~ /^\s*$/ || $l =~ /^\s*#/); - - push(@pkglist, $l); + next if ($line =~ /^\s*$/ || $line =~ /^\s*#/); + push(@pkglist, $line); } close(BNDFILE);