def get_reboot_type(task_state, current_power_state):
 if (current_power_state != power_state.RUNNING):
  return 'HARD'
 soft_types = [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING, task_states.REBOOTING]
 reboot_type = ('SOFT' if (task_state in soft_types) else 'HARD')
 return reboot_type

def get_reboot_type ( task_state , current_power_state ) : if ( current_power_state != power_state . RUNNING ) : return 'HARD' soft_types = [ task_states . REBOOT_STARTED , task_states . REBOOT_PENDING , task_states . REBOOTING ] reboot_type = ( 'SOFT' if ( task_state in soft_types ) else 'HARD' ) return reboot_type
checks if the current instance state requires a hard reboot .