Revamp fencing order

Prevents unnecessarily excessive timeouts if IPMI connections time out;
before, would have to go through 3 timed out commands at ~20s each
before failure was registered; reduced to 1 if the first times out.
This commit is contained in:
Joshua Boniface 2020-12-15 02:45:38 -05:00
parent 37c3b4ef80
commit ac3ef3d792
1 changed files with 13 additions and 8 deletions

View File

@ -124,6 +124,11 @@ def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password, logger):
) )
ipmi_reset_retcode, ipmi_reset_stdout, ipmi_reset_stderr = common.run_os_command(ipmi_command_reset) ipmi_reset_retcode, ipmi_reset_stdout, ipmi_reset_stderr = common.run_os_command(ipmi_command_reset)
if ipmi_reset_retcode != 0:
logger.out('Failed to reboot dead node', state='e')
print(ipmi_reset_stderr)
return False
time.sleep(2) time.sleep(2)
# Ensure the node is powered on # Ensure the node is powered on
@ -139,14 +144,14 @@ def rebootViaIPMI(ipmi_hostname, ipmi_user, ipmi_password, logger):
) )
ipmi_start_retcode, ipmi_start_stdout, ipmi_start_stderr = common.run_os_command(ipmi_command_start) ipmi_start_retcode, ipmi_start_stdout, ipmi_start_stderr = common.run_os_command(ipmi_command_start)
# Declare success or failure if ipmi_start_retcode != 0:
if ipmi_reset_retcode == 0: logger.out('Failed to start powered-off dead node', state='e')
logger.out('Successfully rebooted dead node', state='o') print(ipmi_reset_stderr)
return True return False
else:
logger.out('Failed to reboot dead node', state='e') # Declare success
print(ipmi_reset_stderr) logger.out('Successfully rebooted dead node', state='o')
return False return True
# #