From 7c66aec2ea887bc2b2a5dba4b185a8535afe7bb5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 7 Nov 2017 15:17:00 -0500 Subject: [PATCH] Skip connection to BMC on rpower reseat rpower reseat gets directed at the chassis manager. Skip the superfluous connection to the BMC and keep it from interfering with the reseat. --- xCAT-server/lib/xcat/plugins/ipmi.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 699112ff9..56db4df57 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -527,7 +527,7 @@ sub on_bmc_connect { return; } if ($command eq "rpower") { - unless (defined $sessdata->{device_id}) { #need get device id data initted for S3 support + unless ($sessdata->{subcommand} eq "reseat" or defined $sessdata->{device_id}) { #need get device id data initted for S3 support $sessdata->{ipmisession}->subcmd(netfn => 6, command => 1, data => [], callback => \&gotdevid, callback_args => $sessdata); return; } @@ -8993,13 +8993,18 @@ sub donode { $sessiondata{$node} = { node => $node, #this seems redundant, but some code will not be privy to what the key was bmcnum => $bmcnum, - ipmisession => xCAT::IPMI->new(bmc => $bmcip, userid => $user, password => $pass), + #ipmisession => xCAT::IPMI->new(bmc => $bmcip, userid => $user, password => $pass), command => $command, extraargs => \@exargs, subcommand => $exargs[0], xcatdebugmode => $xcatdebugmode, outfunc => $callback, }; + if ($command eq "rpower" and $exargs[0] eq "reseat") { + on_bmc_connect(0, $sessiondata{$node}); + return 0; + } + $sessiondata{$node}->{ipmisession} = xCAT::IPMI->new(bmc => $bmcip, userid => $user, password => $pass); if ($sessiondata{$node}->{ipmisession}->{error}) { xCAT::SvrUtils::sendmsg([ 1, $sessiondata{$node}->{ipmisession}->{error} ], $callback, $node, %allerrornodes); } else {