use xCAT::Utils->get_site_attribute() instead of opening the site to read the attr

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12790 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jjhua 2012-05-18 07:53:50 +00:00
parent 9ac4324794
commit 2a89911f9e

View File

@ -6318,16 +6318,18 @@ sub enablessh
# if not a service node we need to check, before enabling
my $values;
if (keys %::XCATSITEVALS) {
$values=$::XCATSITEVALS{sshbetweennodes};
} else {
my $sitetab = xCAT::Table->new('site');
my $attr = "sshbetweennodes";
my $ref = $sitetab->getAttribs({key => $attr}, 'value');
if ($ref) {
$values = $ref->{value};
}
}
#if (keys %::XCATSITEVALS) {
# $values=$::XCATSITEVALS{sshbetweennodes};
#} else {
# my $sitetab = xCAT::Table->new('site');
# my $attr = "sshbetweennodes";
# my $ref = $sitetab->getAttribs({key => $attr}, 'value');
# if ($ref) {
# $values = $ref->{value};
# }
#}
my @vals = xCAT::Utils->get_site_attribute("sshbetweennodes");
$values = $vals[0];
if ($values) {
my @groups = split(/,/, $values);
if (grep(/^ALLGROUPS$/, @groups))