def _get_power_status(ssh_obj, driver_info):
    power_state = None
    node_name = _get_hosts_name_for_node(ssh_obj, driver_info)
    # Get a list of vms running on the host. If the command supports
    # it, explicitly specify the desired node."
    cmd_to_exec = "%s %s" % (driver_info['cmd_set']['base_cmd'],
                             driver_info['cmd_set']['list_running'])
    cmd_to_exec = cmd_to_exec.replace('{_NodeName_}', node_name)
    running_list = _ssh_execute(ssh_obj, cmd_to_exec)

    # Command should return a list of running vms. If the current node is
    # not listed then we can assume it is not powered on.
    quoted_node_name = '"%s"' % node_name
    for node in running_list:
        if not node:
            continue
        # 'node' here is a formatted output from the virt cli's. The
        # node name is either an exact match or quoted (optionally with
        # other information, e.g. vbox returns '"NodeName" {<uuid>}')
        if (quoted_node_name in node) or (node_name == node):
            power_state = states.POWER_ON
            break
    if not power_state:
        power_state = states.POWER_OFF

    return power_state
Returns a node's current power state.
dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ssh.py/_get_power_status