From 947749a77d4e84830c06c2e9209a258a36808e5e Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 2 Nov 2010 12:19:54 +0000 Subject: [PATCH] use enablessh routine for Utils.pm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8001 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/perl/xCAT/Postage.pm | 62 +++------------------------- 1 file changed, 6 insertions(+), 56 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/Postage.pm b/xCAT-server/lib/perl/xCAT/Postage.pm index 42cc4a6e4..63923c424 100644 --- a/xCAT-server/lib/perl/xCAT/Postage.pm +++ b/xCAT-server/lib/perl/xCAT/Postage.pm @@ -180,64 +180,14 @@ sub makescript } } # end site table attributes # read the sshbetweennodes attribute and process - if (xCAT::Utils->isSN($node)) - { + my $enablessh=xCAT::Utils->enablessh($node); + if ($enablessh == 1) { push @scriptd, "ENABLESSHBETWEENNODES=YES\n"; push @scriptd, "export ENABLESSHBETWEENNODES\n"; - } - else - { - - # if not a service node we need to check, before enabling - my $attr = "sshbetweennodes"; - my $ref = $sitetab->getAttribs({key => $attr}, 'value'); - if ($ref) - { - my $values = $ref->{value}; - my @groups = split(/,/, $values); - if (grep(/^ALLGROUPS$/, @groups)) - { - push @scriptd, "ENABLESSHBETWEENNODES=YES\n"; - push @scriptd, "export ENABLESSHBETWEENNODES\n"; - } - else - { - if (grep(/^NOGROUPS$/, @groups)) - { - push @scriptd, "ENABLESSHBETWEENNODES=NO\n"; - push @scriptd, "export ENABLESSHBETWEENNODES\n"; - } - else - { # check to see if the node is a member of a group - my $ismember = 0; - foreach my $group (@groups) - { - $ismember = xCAT::Utils->isMemberofGroup($node, $group); - if ($ismember == 1) - { - last; - } - } - if ($ismember == 1) - { - push @scriptd, "ENABLESSHBETWEENNODES=YES\n"; - push @scriptd, "export ENABLESSHBETWEENNODES\n"; - } - else - { - push @scriptd, "ENABLESSHBETWEENNODES=NO\n"; - push @scriptd, "export ENABLESSHBETWEENNODES\n"; - } - } - } - } - else - { # does not exist, set default - push @scriptd, "ENABLESSHBETWEENNODES=YES\n"; - push @scriptd, "export ENABLESSHBETWEENNODES\n"; - - } - } + } else { + push @scriptd, "ENABLESSHBETWEENNODES=NO\n"; + push @scriptd, "export ENABLESSHBETWEENNODES\n"; + } if ($masterset == 0) {