handle easy regx expressions

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@15703 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
lissav 2013-03-28 12:06:27 +00:00
parent 5cabc2b9ef
commit abf400572b

View File

@ -2280,17 +2280,16 @@ sub getNodeAttribs
#skip undefined values, save time
next;
}
if ($datum->{$attrib} =~ /^\/[^\/]*\/[^\/]*\/$/)
{
my $exp = substr($datum->{$attrib}, 1);
chop $exp;
my @parts = split('/', $exp, 2);
my $retval = $node;
my $retval = $node;
$retval =~ s/$parts[0]/$parts[1]/;
$datum->{$attrib} = $retval;
}
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
elsif ($datum->{$attrib} =~ /^\|.*\|$/)
{
#Perform arithmetic and only arithmetic operations in bracketed issues on the right.
@ -2300,6 +2299,14 @@ sub getNodeAttribs
my $exp = substr($datum->{$attrib}, 1);
chop $exp;
my @parts = split('\|', $exp, 2);
my $arraySize = @parts;
if ($arraySize < 2) { # easy regx, generate lhs from node
my $lhs;
my @numbers = $node =~ m/[\D0]*(\d+)/g;
$lhs = '[\D0]*(\d+)' x scalar(@numbers);
$lhs .= '.*$';
unshift(@parts,$lhs);
}
my $curr;
my $next;
my $prev;