diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index fce666a98..4eddb716a 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -210,7 +210,10 @@ sub refresh_switch { my $switch = shift; my $snmpver=1; my $privproto='AES'; - my $swent=$switchestab->getAttribs({switch=>$switch},[qw(snmpversion username password privacy auth)]); + my $swent; + if ($switchestab) { + $swent=$switchestab->getAttribs({switch=>$switch},[qw(snmpversion username password privacy auth)]); + } $session = new SNMP::Session( DestHost => $switch, Version => '1',