

@task_manager.require_exclusive_lock
def reboot(self, task):
    "Perform a hard reboot of the task's node.\n\n        If the node is already powered on then it shall reboot the node, if\n        its off then the node will just be turned on.\n\n        :param task: a TaskManager instance containing the node to act on.\n        :raises: MissingParameterValue if a required parameter is missing.\n        :raises: CIMCException if there is an error communicating with CIMC\n        "
    current_power_state = self.get_power_state(self)
    if (current_power_state == states.POWER_ON):
        self.set_power_state(task, states.REBOOT)
    elif (current_power_state == states.POWER_OFF):
        self.set_power_state(task, states.POWER_ON)

dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/cimc/power.py Power.reboot/VarMisuse@25/192 `task`->`self`