From c90760a14c65bee749836548f9a0fdf6e66659b3 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 29 Oct 2008 15:57:35 +0000 Subject: [PATCH] more fixes for -i flag git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2411 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/SINV.pm | 61 ++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/perl-xCAT/xCAT/SINV.pm b/perl-xCAT/xCAT/SINV.pm index b58e28776..cc872d4c7 100644 --- a/perl-xCAT/xCAT/SINV.pm +++ b/perl-xCAT/xCAT/SINV.pm @@ -337,20 +337,16 @@ sub parse_and_run_sinv } else { - if ($admintemplate eq "NO") # default the seed node - { # admin did not generate a template - 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; + if ($admintemplate eq "NO") # default the seed node + { # admin did not generate a template + 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; } } } @@ -1071,18 +1067,6 @@ sub writereport { xCAT::MsgUtils->message("I", $rsp, $callback); } - if ($ignorefirsttemplate eq "YES") - { - my $rsp = {}; - $rsp->{data}->[0] = - "Ignore flag chosen, not reporting matches on first template.\n"; - print $::OUTPUT_FILE_HANDLE $rsp->{data}->[0]; - if ($::VERBOSE) - { - xCAT::MsgUtils->message("I", $rsp, $callback); - } - next; - } #print list of nodes @nodenames = @{$nodehash{$template}}; @@ -1090,11 +1074,24 @@ sub writereport { my @shortnodename = split(/\./, $nodename); push @nodearray, $shortnodename[0]; # build an array of the nodes - $rsp->{data}->[0] = "$shortnodename[0]\n"; - print $::OUTPUT_FILE_HANDLE $rsp->{data}->[0]; - if ($::VERBOSE) - { - xCAT::MsgUtils->message("I", $rsp, $callback); + if ($ignorefirsttemplate ne "YES") + { # report first template + $rsp->{data}->[0] = "$shortnodename[0]\n"; + print $::OUTPUT_FILE_HANDLE $rsp->{data}->[0]; + if ($::VERBOSE) + { + xCAT::MsgUtils->message("I", $rsp, $callback); + } + } + else + { # do not report nodes on first template + $rsp->{data}->[0] = + "Not reporting matches on first template.\n"; + print $::OUTPUT_FILE_HANDLE $rsp->{data}->[0]; + if ($::VERBOSE) + { + xCAT::MsgUtils->message("I", $rsp, $callback); + } } } $ignorefirsttemplate = "NO"; # reset for remaining templates @@ -1109,7 +1106,7 @@ sub writereport foreach my $dshnodename (@dshnodearray) { if ($dshnodename ne "NO_NODE_RANGE") - { # skip it + { # skip it my @shortdshnodename; my @shortnodename; chomp $dshnodename;