From bd30724e8215f5fb997b160ace444ba6b541f036 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 31 Oct 2008 19:17:40 +0000 Subject: [PATCH] add check for no input to nodestat git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2443 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/nodestat.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/nodestat.pm b/xCAT-server/lib/xcat/plugins/nodestat.pm index c42ec3ed8..94017910d 100644 --- a/xCAT-server/lib/xcat/plugins/nodestat.pm +++ b/xCAT-server/lib/xcat/plugins/nodestat.pm @@ -96,9 +96,14 @@ sub preprocess_request } else { # non node options like -h - my $args=$req->{arg}; @ARGV=(); - @ARGV=@{$args}; + my $args=$req->{arg}; + if ($args) { + @ARGV = @{$args}; + } else { + &usage($cb); + return(1); + } # parse the options Getopt::Long::Configure("posix_default"); Getopt::Long::Configure("no_gnu_compat");