Fix bug 3096172, make the "mkvm" can handle the lhea_logical_ports like :"23000000/2/0/1/all/all,\"\"23000000/1/1/5/all/120e994fcf04,120e994fcf05\"\",23000000/2/1/3/all/all\"

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8087 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
yinle 2010-11-08 06:59:51 +00:00
parent 7169e95d7f
commit dbbe7d72d9

View File

@ -1503,23 +1503,24 @@ sub lhea_adapter {
# seperated list of adapters
#####################################
my $delim = ( $1 =~ /^\"/ ) ? "\\\\\"" : ",";
$cfgdata =~ /lhea_logical_ports=([^$delim]+)|$/;
#$cfgdata =~ /lhea_logical_ports=([^$delim]+)|$/;
$cfgdata =~ /lhea_logical_ports=(.*)lhea_capabilities/;
my @lhea = split ",", $1;
foreach ( @lhea )
{
if ( /^(\d+)\/(\d+)\/(\d+)\/(\d+)/)
if ( /(\d+)\/(\d+)\/(\d+)\/(\d+)/)
{
my $id = $4;
if($id =~ /\d+/)
{
$id = $id + 1;
}
s/^(\d+)\/(\d+)\/(\d+)\/(\d+)/$1\/$2\/$3\/$id/;
s/(\d+)\/(\d+)\/(\d+)\/(\d+)/$1\/$2\/$3\/$id/;
}
}
my $adapters = "lhea_logical_ports=".join( ",", @lhea );
$cfgdata =~ s/lhea_logical_ports=[^$delim]+/$adapters/;
#$cfgdata =~ s/lhea_logical_ports=[^$delim]+/$adapters/;
$cfgdata =~ s/lhea_logical_ports=(.*)lhea_capabilities/$adapters,lhea_capabilities/;
}
return( $cfgdata );
}