2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge pull request #4313 from immarvin/onissue

fix issue #4299 `xdsh` return with no output when "site.master" is not set
This commit is contained in:
Bin Xu 2017-11-16 16:03:45 +08:00 committed by GitHub
commit 7f3f7bec5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -509,8 +509,11 @@ sub get_ServiceNode
# get site.master this will be the default
my $master = xCAT::TableUtils->get_site_Master();
$noderestab = xCAT::Table->new('noderes');
unless($master){
xCAT::MsgUtils->message('SW',"site.master is not set!\n");
}
$noderestab = xCAT::Table->new('noderes');
unless ($noderestab) # no noderes table, use default site.master
{
xCAT::MsgUtils->message('I',
@ -548,7 +551,7 @@ sub get_ServiceNode
my $key = $rec->{$snattribute};
push @{ $snhash{$key} }, $node;
}
else # use site.master
elsif($master) # use site.master
{
push @{ $snhash{$master} }, $node;
}
@ -595,7 +598,7 @@ sub get_ServiceNode
my $key = $rec->{$snattribute};
push @{ $snhash{$key} }, $node;
}
else
elsif($master)
{ # use site.master
push @{ $snhash{$master} }, $node;
}
@ -631,7 +634,7 @@ sub get_ServiceNode
my $key = $rec->{$snattribute};
push @{ $snhash{$key} }, $node;
}
else
elsif($master)
{ # use site.master
push @{ $snhash{$master} }, $node;
}
@ -675,7 +678,7 @@ sub get_ServiceNode
my $key = $sn->{$snattribute};
push @{ $snhash{$key} }, $node;
}
else
elsif($master)
{ # no service node use master
push @{ $snhash{$master} }, $node;
}