

@task_manager.require_exclusive_lock
@ucs_helper.requires_ucs_client
def reboot(self, task, helper=None):
    'Cycles the power to a node.\n\n        :param task: a TaskManager instance.\n        :param helper: ucs helper instance.\n        :raises: UcsOperationError on error from UCS Client.\n        :raises: PowerStateFailure if the final state of the node is not\n            POWER_ON.\n        '
    try:
        ucs_power_handle = ucs_power.UcsPower(helper)
        ucs_power_handle.reboot()
    except ucs_error.UcsOperationError as ucs_exception:
        LOG.error(_LE('%(driver)s: driver failed to reset node %(uuid)s power state.'), {
            'driver': task.node.driver,
            'uuid': task.node.uuid,
        })
        operation = _('rebooting')
        raise exception.UcsOperationError(operation=operation, error=ucs_exception, node=task.node.uuid)
    state = _wait_for_state_change(states.POWER_ON, ucs_power_handle)
    if (state != states.POWER_ON):
        timeout = (CONF.cisco_ucs.action_interval * CONF.cisco_ucs.max_retry)
        LOG.error(_LE('%(driver)s: driver failed to reboot node %(uuid)s within %(timeout)s seconds.'), {
            'driver': task.node.driver,
            'uuid': task.node.uuid,
            'timeout': timeout,
        })
        raise exception.PowerStateFailure(pstate=states.POWER_ON)

dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ucs/power.py Power.reboot/original