Correctly parse subprocess object

This commit is contained in:
Joshua Boniface 2018-07-17 02:39:03 -04:00
parent 68ab7da2aa
commit fa46bd47d6
1 changed files with 1 additions and 1 deletions

View File

@ -383,7 +383,7 @@ def migrateFromFencedHost(zk_conn, node_name):
def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password): def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password):
ipmi_command = ['/usr/bin/ipmitool', '-I', 'lanplus', '-H', ipmi_hostname, '-U', ipmi_user, '-P', ipmi_password, 'chassis', 'power', 'reset'] ipmi_command = ['/usr/bin/ipmitool', '-I', 'lanplus', '-H', ipmi_hostname, '-U', ipmi_user, '-P', ipmi_password, 'chassis', 'power', 'reset']
ipmi_command_output = subprocess.run(ipmi_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) ipmi_command_output = subprocess.run(ipmi_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if ipmi_command_output == 0: if ipmi_command_output.returncode == 0:
ansiiprint.echo('Successfully rebooted dead node', '', 'o') ansiiprint.echo('Successfully rebooted dead node', '', 'o')
return True return True
else: else: