-Support more complex selection primitives in unattend/kickstart/autoyast templates

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3598 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-06-17 21:03:08 +00:00
parent b1744c4d18
commit 389581face

View File

@ -167,6 +167,7 @@ sub tabdb
return "";
}
my $ent;
my $bynode=0;
if ($key eq "THISNODE" or $key eq '$NODE') {
$ent = $tabh->getNodeAttribs($node,[$field]);
$key="node=$node";
@ -175,10 +176,28 @@ sub tabdb
foreach (split /,/,$key) {
my $key;
my $val;
($key,$val) = split /=/,$_;
$kp{$key}=$val;
if ($_ eq 'THISNODE' or $_ eq '$NODE') {
$bynode=1;
} else {
($key,$val) = split /=/,$_;
$kp{$key}=$val;
}
}
if ($bynode) {
my @ents = $tabh->getNodeAttribs($node,[keys %kp,$field]);
my $tent; #Temporary ent
TENT: foreach $tent (@ents) {
foreach (keys %kp) {
unless ($kp{$_} eq $tent->{$_}) {
next TENT;
}
} #If still here, we found it
$ent = $tent;
}
} else {
($ent) = $tabh->getAttribs(\%kp,$field);
}
($ent) = $tabh->getAttribs(\%kp,$field);
}
$tabh->close;
unless($ent and defined($ent->{$field})) {