Fix bug 3214967 and 3222676, modify the command of processing lsslp.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9099 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
911e02cd1c
commit
12718d784c
67
xCAT-client/bin/lsslp
Normal file
67
xCAT-client/bin/lsslp
Normal file
@ -0,0 +1,67 @@
|
||||
#!/usr/bin/perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Client;
|
||||
|
||||
use Getopt::Std;
|
||||
|
||||
my $bname = basename($0);
|
||||
#########################################
|
||||
# Main
|
||||
#
|
||||
# lsslp
|
||||
#
|
||||
# Build hash and submit request
|
||||
#
|
||||
# Handles: lsslp
|
||||
#
|
||||
# Note: The subroutines that implement these commands are in:
|
||||
# /opt/xcat/lib/perl/xCAT_plugin/lsslp.pm
|
||||
#
|
||||
#########################################
|
||||
my $cmdref;
|
||||
# set the command name to pass to the plugin
|
||||
if ($bname =~ /lsslp/)
|
||||
{
|
||||
$cmdref->{command}->[0] = $bname;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Bad usage\n");
|
||||
exit 1;
|
||||
}
|
||||
|
||||
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
# get info from files piped in as stdin
|
||||
if (-p STDIN) {
|
||||
my $data;
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
|
||||
# add all the cmd line args to the hash - to pass to the plugin subroutine
|
||||
foreach my $a (@ARGV)
|
||||
{
|
||||
if ($a =~ /^\w+\-\w+$/)
|
||||
{
|
||||
push @{$cmdref->{noderange}}, $a;
|
||||
} else
|
||||
{
|
||||
push @{$cmdref->{arg}}, $a;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (keys %ENV) {
|
||||
if (/^XCAT_/) {
|
||||
$cmdref->{environment}->{$_} = $ENV{$_};
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);
|
||||
exit $xCAT::Client::EXITCODE;
|
Loading…
Reference in New Issue
Block a user