From a0200d9013534c9f7012850a43f7ec79edef357c Mon Sep 17 00:00:00 2001 From: nott Date: Wed, 10 Sep 2008 14:32:19 +0000 Subject: [PATCH] Updates to support AIX service nodes. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2118 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xcatDBcmds | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/xCAT-client/bin/xcatDBcmds b/xCAT-client/bin/xcatDBcmds index 56ad1474e..5b43a4ddf 100755 --- a/xCAT-client/bin/xcatDBcmds +++ b/xCAT-client/bin/xcatDBcmds @@ -10,6 +10,8 @@ use File::Basename; use xCAT::MsgUtils; use xCAT::Client; +use Getopt::Std; + my $bname = basename($0); ######################################### @@ -19,14 +21,15 @@ my $bname = basename($0); # # Build hash and submit request # -# Handles: mkdef, chdef, lsdef, rmdef, and xcat2nim commands +# Handles: mkdef, chdef, lsdef, rmdef, mknimimage, rmnimimage, +# nimnodeset, mkdsklsnode, rmdsklsnode, and xcat2nim commands # # Note: The subroutines that implement these commands # are, for the most part, in: # /opt/xcat/lib/perl/xCAT_plugin/DBobjectdefs.pm # /opt/xcat/lib/perl/xCAT_plugin/xcat2nim.pm +# /opt/xcat/lib/perl/xCAT_plugin/aixinstall.pm # /opt/xcat/lib/perl/xCAT/DBobjUtils.pm -# -on the xCAT management node # ######################################### @@ -57,9 +60,24 @@ if (-p STDIN) { } # add all the cmd line args to the hash - to pass to the plugin subroutine -foreach (@ARGV) +foreach my $a (@ARGV) { - push(@{$cmdref->{arg}}, $_); + push(@{$cmdref->{arg}}, $a); +} + +# For some commands we need to set the noderange value +# - don't want to depend on the order of args so need to pick +# the operand that doesn't have an "=" sign ( ie. attr=val format) +my @checkcmds = ("nimnodeset", "mkdsklsnode", "rmdsklsnode", "xcat2nim"); +if (grep(/^$bname$/, @checkcmds) ) { + # strip off all options + getopts('ab:fh?i:l:urs:m:no:t:vV'); + # check the operands for a noderange + while (my $a = shift(@ARGV)) { + if (!($a =~ /=/)) { + $cmdref->{noderange}->[0]=$a; + } + } } xCAT::Client::submit_request($cmdref,\&xCAT::Client::handle_response);