check for duplicate entries in statelite table

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8780 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2011-02-01 17:01:40 +00:00
parent 03d26ffa8d
commit ca225c7dfe

View File

@ -894,6 +894,34 @@ sub dolitesetup
return 1;
}
#
# Check the statelite table for duplicate node entries
#
my $recs=$statelitetab->getAllEntries();
my @SLnodes;
foreach my $entry (@$recs) {
# get the "node" value
my $node = $entry->{node};
# run it through noderange
my @newnodes = xCAT::NodeRange::noderange($node);
# for each node - see if it's already in the list
foreach my $n (@newnodes) {
if (!grep (/^$n$/, @SLnodes) ) {
push(@SLnodes, $n);
} else {
# if it's already in the list then this is an error
my $rsp;
push @{$rsp->{data}}, "The node \'$n\' is included in multiple statelite entries.\n";
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
}
}
}
# create the statelite table file
my $stateHash = $statelitetab->getNodesAttribs(\@nodelist, ['statemnt']);
foreach my $node (@nodelist) {
@ -945,6 +973,7 @@ sub dolitesetup
}
my @filelist = xCAT::Utils->runcmd("/opt/xcat/bin/litefile $noderange", -1);
foreach my $l (@filelist) {
$l =~ s/://g; # remove ":"'s
$l =~ s/\s+/|/g; # change separator to "|"