fix for bug 3935: support nic name with space, like Local Area Network on windows
This commit is contained in:
		| @@ -2747,7 +2747,7 @@ sub collapsenicsattr() | ||||
|         # e.g nicips.eth0 | ||||
|         # do not need to handle nic attributes without the postfix .ethx, | ||||
|         # it will be overwritten by the attributes with the postfix .ethx, | ||||
|         if ($nodeattr =~ /^(nic\w+)\.(\w+)$/) | ||||
|         if ($nodeattr =~ /^(nic\w+)\.(.*)$/) | ||||
|         {        | ||||
|            if ($1 && $2) | ||||
|            {        | ||||
|   | ||||
| @@ -622,7 +622,8 @@ sub processArgs | ||||
|  | ||||
|             # if it has an "=" sign its an attr=val - we hope | ||||
|             #   - this will handle "attr= " | ||||
|             my ($attr, $value) = $a =~ /^\s*(\S+?)\s*=\s*(\S*.*)$/; | ||||
|             # The attribute itself might contain "space", like "nics.Local Connection Adapter 1" on windows | ||||
|             my ($attr, $value) = $a =~ /^\s*(.*?)\s*=\s*(\S*.*)$/; | ||||
|             if (!defined($attr) || !defined($value)) | ||||
|             { | ||||
|                 my $rsp; | ||||
| @@ -644,7 +645,7 @@ sub processArgs | ||||
|         my $nicattrs = 0; | ||||
|         foreach my $kattr (keys %::ATTRS) | ||||
|         { | ||||
|             if ($kattr =~ /^nic\w+\.\w+$/) | ||||
|             if ($kattr =~ /^nic\w+\..*$/) | ||||
|             { | ||||
|                 $nicattrs = 1; | ||||
|             } | ||||
| @@ -850,7 +851,7 @@ sub processArgs | ||||
|                 foreach my $dattr (@dispattrs) | ||||
|                 { | ||||
|                     # lsdef -t node -h -i nicips.eth0 | ||||
|                     if($dattr =~ /^(nic\w+)\.\w+$/) | ||||
|                     if($dattr =~ /^(nic\w+)\..*$/) | ||||
|                     { | ||||
|                         $dattr = $1; | ||||
|                     } | ||||
| @@ -1148,7 +1149,7 @@ sub processArgs | ||||
|         my $i = 0; | ||||
|         for ($i=0; $i < (scalar @::AttrList) ; $i++ ) | ||||
|         { | ||||
|             if($::AttrList[$i] =~ /^(nic\w+)\.(\w+)$/) | ||||
|             if($::AttrList[$i] =~ /^(nic\w+)\.(.*)$/) | ||||
|             { | ||||
|                 $::AttrList[$i] = $1;  | ||||
|                 push @{$::NicsAttrHash{$::AttrList[$i]}}, $2; | ||||
| @@ -1304,7 +1305,7 @@ sub defmk | ||||
|             { | ||||
|                 my $attrorig = $attr; | ||||
|                 # nicips.eth0 => nicips | ||||
|                 if ($attr =~ /^(nic\w+)\.\w+$/) | ||||
|                 if ($attr =~ /^(nic\w+)\..*$/) | ||||
|                 { | ||||
|                     $attr = $1; | ||||
|                 } | ||||
| @@ -1948,7 +1949,7 @@ sub defch | ||||
|             { | ||||
|                 my $attrorig = $attr; | ||||
|                 # nicips.eth0 => nicips | ||||
|                 if ($attr =~ /^(nic\w+)\.\w+$/) | ||||
|                 if ($attr =~ /^(nic\w+)\..*$/) | ||||
|                 { | ||||
|                     $attr = $1; | ||||
|                 } | ||||
| @@ -2635,7 +2636,7 @@ sub setFINALattrs | ||||
|             my %tmphash = (); | ||||
|             foreach my $nodeattr (keys %{$::CLIATTRS{$objname}}) | ||||
|             { | ||||
|                 if ($nodeattr =~ /^(nic\w+)\.\w+$/) | ||||
|                 if ($nodeattr =~ /^(nic\w+)\..*$/) | ||||
|                 { | ||||
|                     my $tmpnicattr = $1; | ||||
|                     if (!defined($tmphash{$tmpnicattr})) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user