diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 29922d975..41f8dfb7b 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -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]}}); diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 672986733..30ba0d952 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -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,