From 991fc8adc8dff982a47fcb5ea51f16ae4a085a89 Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 28 Oct 2008 16:34:40 +0000 Subject: [PATCH] fix handling of default seed node git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2403 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/SINV.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/perl-xCAT/xCAT/SINV.pm b/perl-xCAT/xCAT/SINV.pm index e76cf610b..ebad41f71 100644 --- a/perl-xCAT/xCAT/SINV.pm +++ b/perl-xCAT/xCAT/SINV.pm @@ -327,7 +327,7 @@ sub parse_and_run_sinv # Get seed node if it exists to build the original template # if seed node does not exist and the admin did not submit a # template, the the first node becomes the seed node - # + # if there is no nodelist then error my @seed; my $seednode = $options{'seed_node'}; if ($seednode) @@ -337,10 +337,17 @@ sub parse_and_run_sinv } else { - if ($admintemplate eq "NO") + if ($admintemplate eq "NO") # default the seed node { # admin did not generate a template - push @seed, $nodelist[$#nodelist]; # assign last element as seed - $seednode = $nodelist[$#nodelist]; + if ($nodelist[0] ne "NO_NODE_RANGE") { + push @seed, $nodelist[0]; # assign first element as seed + $seednode = $nodelist[0]; + } else { # error cannot default + my $rsp = {}; + $rsp->{data}->[0] = "No template or seed node supplied and no noderange to chose a default.\n"; + xCAT::MsgUtils->message("E", $rsp, $callback,1); + exit 1; + } } }