From 1bc15b29ce0d9f9f4e5fca0bf05c3c24169f94fb Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 3 Apr 2009 18:37:57 +0000 Subject: [PATCH] allow -K -l if --devicetype is specified git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3086 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-client/bin/xdsh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xCAT-client/bin/xdsh b/xCAT-client/bin/xdsh index 6534a566a..6ed92d2bd 100644 --- a/xCAT-client/bin/xdsh +++ b/xCAT-client/bin/xdsh @@ -260,13 +260,14 @@ sub parse_args_xdsh $to_userid = $current_userid; } $ENV{DSH_TO_USERID} = $to_userid; - # cannot use -K and -l options together - if (($options{'ssh-setup'}) && ($options{'user'})) { - my $msg = "The -K option and the -l option are not supported together.\n"; + + # only allow -K with -l if --devicetype defined + if ((($options{'user'}) && ($options{'ssh-setup'})) + && (!($options{'devicetype'}))) { + my $msg = "The -K and -l flag may only be used if --devicetype is specified\n."; xCAT::MsgUtils->message("E", $msg); exit 2; } - if ($options{'ssh-setup'}) # if going to setup ssh keys { @@ -319,8 +320,9 @@ sub parse_args_xdsh exit 2; } - # add config file with stict host checking no - my $cmd="echo \"StrictHostKeyChecking no\" >> $home/.ssh/config"; + + # add config file with stict host checking no + my $cmd = "echo \"StrictHostKeyChecking no\" >> $home/.ssh/config"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { # error @@ -328,7 +330,7 @@ sub parse_args_xdsh xCAT::MsgUtils->message("E", $msg); } - my $cmd="chmod 0600 $home/.ssh/config"; + my $cmd = "chmod 0600 $home/.ssh/config"; xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { # error