From edc62bb3467e99eb44ace9510e3a36cbc3ba9894 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 7 Nov 2013 10:31:15 -0500 Subject: [PATCH] Add option to xcoll for individual output (-i) --- xCAT-client/bin/xcoll | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/xCAT-client/bin/xcoll b/xCAT-client/bin/xcoll index ef5a47a90..4169edd06 100755 --- a/xCAT-client/bin/xcoll +++ b/xCAT-client/bin/xcoll @@ -10,8 +10,10 @@ my %output; my $option; my $printcount; +my $individual; GetOptions("n"=>\$option, + "i"=>\$individual, "c"=>\$printcount); while () { @@ -27,8 +29,10 @@ while () { $output{$node}.=$output; } my %collated; -foreach (keys %output) { - $collated{$output{$_}}->{$_}=1; +unless ($individual) { + foreach (keys %output) { + $collated{$output{$_}}->{$_}=1; + } } my $nodes; @@ -38,6 +42,16 @@ sub fillerup { $nodes = $response->{data}->[0]; } } +if ($individual) { + foreach my $node (keys %output) { + print "====================================\n"; + print "$node\n"; + print "====================================\n"; + print $output{$node}; + print "\n"; + } + exit(0); +} foreach my $output (keys %collated) { $nodes = join(',',sort (keys %{$collated{$output}})); my $cmdref = {