diff --git a/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm b/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm index 50d0d16f6..2baeafb21 100644 --- a/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm +++ b/xCAT-server-2.0/usr/lib/xcat/plugins/blade.pm @@ -452,7 +452,7 @@ sub power { my $subcommand = shift; my $data; my $stat; - if ($subcommand eq "stat") { + if ($subcommand eq "stat" or $subcommand eq "boot") { $data = $session->get([$powerstatoid.".".$slot]); if ($data == 1) { $stat = "on"; @@ -465,11 +465,12 @@ sub power { $data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,0,'INTEGER'])); unless ($data) { return (1,$session->{ErrorStr}); } $stat = "off"; - } elsif ($subcommand eq "on") { + } + if ($subcommand eq "on" or ($subcommand eq "boot" and $stat eq "off")) { $data = $session->set(new SNMP::Varbind([".".$powerchangeoid,$slot,1,'INTEGER'])); unless ($data) { return (1,$session->{ErrorStr}); } $stat = ($data ? "on" : "off"); - } elsif ($subcommand eq "reset") { + } elsif ($subcommand eq "reset" or ($subcommand eq "boot" and $stat eq "on")) { $data = $session->set(new SNMP::Varbind([".".$powerresetoid,$slot ,1,'INTEGER'])); unless ($data) { return (1,$session->{ErrorStr}); } $stat = "reset";