-Fix problem where explicit nulls were presented subtly differently from implicit nulls
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2585 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
a5363cdba4
commit
fda20c3ade
@ -7,6 +7,7 @@
|
||||
#class xcattable
|
||||
package xCAT::Table;
|
||||
use Sys::Syslog;
|
||||
use Data::Dumper;
|
||||
BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
|
||||
@ -1038,6 +1039,10 @@ sub getNodeAttribs
|
||||
foreach $datum (@data) {
|
||||
foreach $attrib (@attribs)
|
||||
{
|
||||
unless (defined $datum->{$attrib}) {
|
||||
#skip undefined values, save time
|
||||
next;
|
||||
}
|
||||
|
||||
if ($datum->{$attrib} =~ /^\/.*\/.*\/$/)
|
||||
{
|
||||
@ -1068,6 +1073,10 @@ sub getNodeAttribs
|
||||
$retval = $node;
|
||||
$retval =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $retval;
|
||||
if ($datum->{$attrib} =~ /^$/) {
|
||||
#If regex forces a blank, act like a normal blank does
|
||||
delete $datum->{$attrib};
|
||||
}
|
||||
next; #skip the redundancy that follows otherwise
|
||||
}
|
||||
while ($curr)
|
||||
@ -1098,6 +1107,10 @@ sub getNodeAttribs
|
||||
#print Data::Dumper::Dumper(extract_bracketed($parts[1],'()',qr/[^()]*/));
|
||||
#use text::balanced extract_bracketed to parse earch atom, make sure nothing but arith operators, parans, and numbers are in it to guard against code execution
|
||||
}
|
||||
if ($datum->{$attrib} =~ /^$/) {
|
||||
#If regex forces a blank, act like a normal blank does
|
||||
delete $datum->{$attrib};
|
||||
}
|
||||
}
|
||||
}
|
||||
return wantarray ? @data : $data[0];
|
||||
|
Loading…
Reference in New Issue
Block a user