Correct flawed conditional in verify_ipmi

This commit is contained in:
Joshua Boniface 2021-10-07 15:11:19 -04:00
parent c27359c4bf
commit 6ee4c55071
1 changed files with 1 additions and 1 deletions

View File

@ -189,7 +189,7 @@ def reboot_via_ipmi(ipmi_hostname, ipmi_user, ipmi_password, logger):
def verify_ipmi(ipmi_hostname, ipmi_user, ipmi_password): def verify_ipmi(ipmi_hostname, ipmi_user, ipmi_password):
ipmi_command = f'/usr/bin/ipmitool -I lanplus -H {ipmi_hostname} -U {ipmi_user} -P {ipmi_password} chassis power status' ipmi_command = f'/usr/bin/ipmitool -I lanplus -H {ipmi_hostname} -U {ipmi_user} -P {ipmi_password} chassis power status'
retcode, stdout, stderr = common.run_os_command(ipmi_command, timeout=2) retcode, stdout, stderr = common.run_os_command(ipmi_command, timeout=2)
if retcode == 0 and stdout.strip() != "Chassis Power is on": if retcode == 0 and stdout.strip() == "Chassis Power is on":
return True return True
else: else:
return False return False