-fix bug #2381472, add -v|--version options to nodeset

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2579 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
mxi1 2009-01-08 07:00:27 +00:00
parent 9de6917f30
commit 02135314e6
2 changed files with 27 additions and 0 deletions

View File

@ -234,6 +234,16 @@ sub process_request {
} else {
if ($request->{node}) { @rnodes = ($request->{node}); }
}
my $args_ref = $request->{arg};
if(scalar grep(/^--version$|^-v$/, @$args_ref)) {
my $ver = xCAT::Utils->Version();
my %rsp;
$rsp{data}->[0]="$ver";
$callback->(\%rsp);
return;
}
unless (@rnodes) {
if ($usage{$request->{command}->[0]}) {
$callback->({data=>$usage{$request->{command}->[0]}});

View File

@ -256,6 +256,23 @@ sub process_request {
} else {
@args=($request->{arg});
}
if(scalar grep /^--version$|^-v$/, @args) {
my $ver = xCAT::Utils->Version();
my %rsp;
$rsp{data}->[0]="$ver";
$callback->(\%rsp);
return;
}
if(scalar grep /^--help$|^-h$/, @args) {
if($usage{$request->{command}->[0]}) {
my %rsp;
$rsp{data}->[0]=$usage{$request->{command}->[0]};
$callback->(\%rsp);
}
return;
}
unless ($args[0] eq 'stat' or $args[0] eq 'enact') {
$sub_req->({command=>['setdestiny'],
node=>\@nodes,