

def get_power_state(self, task):
    "Return the power state of the task's node.\n\n        :param task: a TaskManager instance containing the node to act on.\n        :raises: MissingParameterValue if a required parameter is missing.\n        :returns: a power state. One of :mod:`ironic.common.states`.\n        :raises: CIMCException if there is an error communicating with CIMC\n        "
    current_power_state = None
    with common.cimc_handle(task) as handle:
        try:
            rack_unit = handle.get_imc_managedobject(None, None, params={
                'Dn': 'sys/rack-unit-1',
            })
        except imcsdk.ImcException as e:
            raise exception.CIMCException(node=task.node.uuid, error=handle)
        else:
            current_power_state = rack_unit[0].get_attr('OperPower')
    return CIMC_TO_IRONIC_POWER_STATE.get(current_power_state, states.ERROR)

dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/cimc/power.py Power.get_power_state/VarMisuse@81/245 `e`->`handle`