diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 3898f63bc..d04018923 100644 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -32,7 +32,7 @@ sub addnode { my $foundone=0; while ($idx <= $#hosts) { - if ($hosts[$idx] =~ /^${ip}\s/ or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.r/) { + if ($hosts[$idx] =~ /^${ip}\s/ or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.]/) { if ($foundone) { $hosts[$idx]=""; } else { diff --git a/xCAT-server/lib/xcat/plugins/tabutils.pm b/xCAT-server/lib/xcat/plugins/tabutils.pm index 2705996b4..d52e315f1 100644 --- a/xCAT-server/lib/xcat/plugins/tabutils.pm +++ b/xCAT-server/lib/xcat/plugins/tabutils.pm @@ -760,7 +760,9 @@ sub nodech if (($key eq 'groups') && ($op eq '=')) { if (scalar(@grplist) == 0) { # Do not call $grptab->getAllEntries for each node, performance issue. $grptab = xCAT::Table->new('nodegroup'); - @grplist = @{$grptab->getAllEntries()}; + if ($grptab) { + @grplist = @{$grptab->getAllEntries()}; + } } my @grps = split(/,/, $val); foreach my $grp (@grps) {