From 6399a3f4174a46b047f69f384a29f56f9d2e259e Mon Sep 17 00:00:00 2001 From: daniceexi Date: Wed, 24 Mar 2010 12:05:58 +0000 Subject: [PATCH] some minor modification related to updatenode --security git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@5568 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/Usage.pm | 10 +++++---- xCAT-client/bin/updatenode | 6 ++++-- xCAT-server/lib/xcat/plugins/updatenode.pm | 25 ++++++++++++---------- xCAT/postscripts/remoteshell | 2 +- xCAT/postscripts/xcatdsklspost | 5 ++++- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index edeac1dd2..c6d36ffad 100644 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -191,9 +191,9 @@ my %usage = ( "Usage: updatenode [-h|--help|-v|--version] or - updatenode [-V|--verbose] [--security] [-s|--sn] + updatenode [-V|--verbose] [-k|--security] [-s|--sn] or - updatenode [-V|--verbose] [--security] [--user] + updatenode [-V|--verbose] [-k|--security] [--user] [--devicetype] or updatenode [-V|--verbose] [-F|--sync] [-S|--sw] @@ -202,8 +202,10 @@ my %usage = ( or updatenode [-V|--verbose] [script1,script2,...] is a list of nodes or groups. - [--security] update the security keys and certificates for the target nodes - [--security] [--user] [--devicetype] update the ssh keys for specific device + [-k|--security] update the security keys and certificates for the + target nodes + [-k|--security] [--user] [--devicetype] update the ssh keys for + specific device [-F|--sync] Perform File Syncing. [-S|--sw] Perform Software Maintenance. [-P|--scripts] Execute postscripts listed in the postscripts table or diff --git a/xCAT-client/bin/updatenode b/xCAT-client/bin/updatenode index 0ea16835f..e13251fef 100755 --- a/xCAT-client/bin/updatenode +++ b/xCAT-client/bin/updatenode @@ -49,7 +49,9 @@ if ($arg !~ /^-/) { $arg = join(',',@tempnr); $cmdref->{noderange}->[0]=$arg; } else { - push @{$cmdref->{arg}}, $arg; + print "The noderange should be the first argument.\n"; + &updatenode_usage(); + exit 1; } push (@{$cmdref->{arg}}, @ARGV); @@ -69,7 +71,7 @@ if ( 'S|sw' => \$::SWMAINTENANCE, 's|sn' => \$::SETSERVER, 'P|scripts:s' => \$::RERUNPS, - 'security' => \$::SECURITY, + 'k|security' => \$::SECURITY, 'user=s' => \$::USER, 'devicetype=s' => \$::DEVICETYPE, ) diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 97f723c08..7d35ee7d6 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -180,7 +180,7 @@ sub preprocess_updatenode 'S|sw' => \$::SWMAINTENANCE, 's|sn' => \$::SETSERVER, 'P|scripts:s' => \$::RERUNPS, - 'security' => \$::SECURITY, + 'k|security' => \$::SECURITY, 'user=s' => \$::USER, 'devicetype=s' => \$::DEVICETYPE, ) @@ -652,14 +652,17 @@ sub updatenode Getopt::Long::Configure("no_pass_through"); if ( !GetOptions( - 'c|cmdlineonly' => \$::CMDLINE, - 'h|help' => \$::HELP, - 'v|version' => \$::VERSION, - 'V|verbose' => \$::VERBOSE, - 'F|sync' => \$::FILESYNC, - 's|sn' => \$::SETSERVER, - 'S|sw' => \$::SWMAINTENANCE, - 'P|scripts:s' => \$::RERUNPS + 'c|cmdlineonly' => \$::CMDLINE, + 'h|help' => \$::HELP, + 'v|version' => \$::VERSION, + 'V|verbose' => \$::VERBOSE, + 'F|sync' => \$::FILESYNC, + 'S|sw' => \$::SWMAINTENANCE, + 's|sn' => \$::SETSERVER, + 'P|scripts:s' => \$::RERUNPS, + 'k|security' => \$::SECURITY, + 'user=s' => \$::USER, + 'devicetype=s' => \$::DEVICETYPE, ) ) { @@ -1015,7 +1018,7 @@ sub updatenode } elsif ($output !~ /Running postscript|Error loading module/) { push @{$rsp->{data}}, "$output"; } - } else { + } elsif ($output !~ /Error loading module/) { push @{$rsp->{data}}, "$output"; } } @@ -1091,7 +1094,7 @@ sub updatenode } elsif ($output !~ /Running postscript|Error loading module/) { push @{$rsp->{data}}, $output; } - } else { + } elsif ($output !~ /Error loading module/) { push @{$rsp->{data}}, "$output"; } } diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index f344608b9..32c84dc2b 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -100,7 +100,7 @@ fi rm /tmp/ssh_rsa_hostkey if [ -r /etc/xCATSN ] ; then - mkdir /etc/xcat/hostkeys + mkdir -p /etc/xcat/hostkeys cp /etc/ssh/ssh* /etc/xcat/hostkeys/. fi diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 493fe0a16..fc052087e 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -3,6 +3,8 @@ ##################################################### # # Generic xCAT post script for diskless nodes +# The syntax of this script +# xcatdsklspost {mode} {-m|-M} [postscirpts] # This script is called in the following different palces: # updatenode -P ... --> xcatdsklspost 1 -m/-M ... # updatenode -S --> xcatdsklspost 2 -m/-M otherpkgs @@ -44,8 +46,9 @@ download_postscripts() # parse the arguments ARGNUM=$#; if [ -z $1 ]; then - NODE_DEPLOYMENT=1 + NODE_DEPLOYMENT=1 else + NODE_DEPLOYMENT=0 case $1 in 1|2|5) MODE=$1