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
This commit is contained in:
lissav 2010-11-02 12:19:54 +00:00
parent fbeaa49a22
commit 947749a77d

View File

@ -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)
{