From dbbe7d72d9bc0f6acb40cb4034af248bc212d792 Mon Sep 17 00:00:00 2001 From: yinle Date: Mon, 8 Nov 2010 06:59:51 +0000 Subject: [PATCH] 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 --- perl-xCAT/xCAT/PPCvm.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/PPCvm.pm b/perl-xCAT/xCAT/PPCvm.pm index 39af9161d..7a7845591 100644 --- a/perl-xCAT/xCAT/PPCvm.pm +++ b/perl-xCAT/xCAT/PPCvm.pm @@ -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 ); }