From a9d04905a32fece1edac6056eb5ccc8c12245c93 Mon Sep 17 00:00:00 2001 From: lissav Date: Fri, 13 Jun 2008 13:12:09 +0000 Subject: [PATCH] add support in dsh context for useSSHonAIX attribute git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1649 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/dsh/Context/XCAT.pm | 30 +++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm index 0b9fd7455..58a02e341 100644 --- a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm +++ b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm @@ -6,6 +6,7 @@ use Socket; use xCAT::Utils; use xCAT::MsgUtils; use base xCAT::DSHContext; + # Define remote shell globals from xCAT our $XCAT_RSH_CMD; @@ -287,8 +288,10 @@ sub resolve_node get_xcat_remote_cmds Using xCAT native commands, store the remote command settings for - the remote shell and remote copy commands as defined in xCAT - site.tab file. + the remote shell and remote copy commands determined from the + site.tab file useSSHonAIX attribute. If the attribute is set to yes or 1 + then we will setup and use ssh on AIX, otherwise we use rsh. On Linux, + we always setup and use ssh. Arguments: None @@ -314,17 +317,22 @@ sub resolve_node #------------------------------------------------------------------------------- sub get_xcat_remote_cmds { - $XCAT_RSH_CMD = "/usr/bin/ssh"; # default - $XCAT_RCP_CMD = "/usr/bin/scp"; #default - my @remote_shell = xCAT::Utils->get_site_attribute("rsh"); - if ($remote_shell[0]) + if (xCAT::Utils::isLinux) { - $XCAT_RSH_CMD = $remote_shell[0]; + $XCAT_RSH_CMD = "/usr/bin/ssh"; # default + $XCAT_RCP_CMD = "/usr/bin/scp"; #default } - my @remote_copy = xCAT::Utils->get_site_attribute("rcp"); - if ($remote_copy[0]) - { - $XCAT_RCP_CMD = $remote_copy[0]; + else + { # AIX + $XCAT_RSH_CMD = "/bin/rsh"; # default + $XCAT_RCP_CMD = "/bin/rcp"; #default + my @usesshonaix = xCAT::Utils->get_site_attribute("useSSHonAIX"); + $usesshonaix[0] =~ tr/a-z/A-Z/; # convert to upper + if (($usesshonaix[0] eq "1") || ($usesshonaix[0] eq "YES")) + { # use ssh/scp + $XCAT_RSH_CMD = "/bin/ssh"; # default + $XCAT_RCP_CMD = "/bin/scp"; #default + } } }