fix parsing of c_disc_target output

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@12795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2012-05-18 14:52:23 +00:00
parent b45e5f91d1
commit 6546665c29

View File

@ -1812,8 +1812,6 @@ sub dump_retarget
# need node gateway
my $gateway = $nethash{$nd}{'gateway'};
# This should configure the iscsi disc on the client
my $tcmd = qq~/usr/lpp/bos.sysmgt/nim/methods/c_disc_target -a operation=discover -a target="$dump_target" -a dump_port="$dump_port" -a ipaddr="$SNip" -a lun_id="$dump_lunid"~;
my $hd = xCAT::InstUtils->xcmd($callback, $sub_req, "xdsh", $nd, $tcmd, 0);
@ -1828,15 +1826,28 @@ n";
}
chomp $hd;
my $hdisk = $hd;
if ($hd =~ /:/) {
my $node;
($node, $hdisk) = split(': ', $hd);
my $hdisk;
foreach my $line ( split(/\n/, $hd )) {
if ( $line =~ /hdisk/ ) {
$hdisk = $line;
if ($line =~ /:/) {
my $node;
($node, $hdisk) = split(': ', $line);
}
}
}
chomp $hdisk;
$hdisk =~ s/\s*//g;
if (!$hdisk) {
my $rsp;
push @{$rsp->{data}}, "Could not determine dump device for node $nd.\n";
xCAT::MsgUtils->message("E", $rsp, $callback);
$error++;
next;
}
# define the disk on the client
my $mkcmd = qq~/usr/sbin/mkdev -l $hdisk~;