diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index 5ba19bd1e..e55a14741 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -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 "|"