'Determine whether the node\'s resources are in an acceptable state.
Determines whether the node\'s resources should be presented
to Nova for use based on the current power, provision and maintenance
state. This is called after _node_resources_used, so any node that
is not used and not in AVAILABLE should be considered in a \'bad\' state,
and unavailable for scheduling. Returns True if unacceptable.'

def _node_resources_unavailable(self, node_obj):

    bad_power_states = [ironic_states.ERROR, ironic_states.NOSTATE]
    good_provision_states = [ironic_states.AVAILABLE, ironic_states.NOSTATE]
    return (node_obj.maintenance or (node_obj.power_state in bad_power_states) or (node_obj.provision_state not in good_provision_states) or ((node_obj.provision_state in good_provision_states) and (node_obj.instance_uuid is not None)))
