diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index d0d29c124..1bac5deb8 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -60,7 +60,7 @@ sub preprocess_request { my $switchestab=xCAT::Table->new('switches',-create=>0); my @all_switches; my @tmp=$switchestab->getAllAttribs(('switch')); - if (defined(@tmp) && (@tmp > 0)) { + if (@tmp && (@tmp > 0)) { foreach(@tmp) { my @switches_tmp=noderange($_->{switch}); if (@switches_tmp==0) { push @switches_tmp, $_->{switch}; }