From bcc4885a7fe4e419861d33bdcdbb16de76258999 Mon Sep 17 00:00:00 2001 From: mxi1 Date: Fri, 2 Apr 2010 10:07:35 +0000 Subject: [PATCH] -bug 2980069 "the litefile command without any argument will return error message" is fixed; git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5654 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/litetree.pm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/litetree.pm b/xCAT-server/lib/xcat/plugins/litetree.pm index 2c45db501..00c6effc8 100644 --- a/xCAT-server/lib/xcat/plugins/litetree.pm +++ b/xCAT-server/lib/xcat/plugins/litetree.pm @@ -36,9 +36,13 @@ sub usage { my $error = shift; my $msg; if($command eq "ilitefile"){ - $msg = "ilitefile -\texample:\n\tilitefile centos5.3-x86_64-compute" - } else{ + $msg = "Usage: ilitefile +\texample:\n\tilitefile centos5.3-x86_64-statelite-compute" + } elsif($command eq "litefile") { + $msg = "Usage: litefile \nexample:\n\tlitefile node1"; + } elsif($command eq "litetree") { + $msg = "Usage: litetree \nexample:\n\tlitetree node1"; + } else{ $msg = "some general usage string"; } @@ -80,13 +84,21 @@ sub process_request { my $command = $request->{command}->[0]; if($command eq "litetree"){ + unless($request->{node}) { + usage($command, $callback, 0); + return 1; + } return syncmount("dir",$request,$callback,$noderange); }elsif($command eq "litefile"){ - return syncmount("file",$request, $callback,$noderange); + unless($request->{node}) { + usage($command, $callback, 0); + return 1; + } + return syncmount("file",$request, $callback,$noderange); }elsif($command eq "ilitefile"){ #print Dumper($request); unless($request->{arg}){ - usage($command, $callback,1); + usage($command, $callback, 0); return 1; } return syncmount("image",$request, $callback,$request->{arg});