Merge "Add bad provision states check for nodes"

This commit is contained in:
Jenkins 2017-08-25 11:39:21 +00:00 committed by Gerrit Code Review
commit f0fec1c8ba
2 changed files with 8 additions and 0 deletions

View File

@ -566,12 +566,14 @@ class IronicDriver(base_driver.BaseEngineDriver):
return [] return []
bad_power_states = [ironic_states.ERROR, ironic_states.NOSTATE] bad_power_states = [ironic_states.ERROR, ironic_states.NOSTATE]
bad_provision_states = [ironic_states.ENROLL]
# keep NOSTATE around for compatibility # keep NOSTATE around for compatibility
good_provision_states = [ good_provision_states = [
ironic_states.AVAILABLE, ironic_states.NOSTATE] ironic_states.AVAILABLE, ironic_states.NOSTATE]
for node_obj in node_list: for node_obj in node_list:
if ((node_obj.resource_class is None) or if ((node_obj.resource_class is None) or
node_obj.power_state in bad_power_states or node_obj.power_state in bad_power_states or
node_obj.provision_state in bad_provision_states or
(node_obj.provision_state in good_provision_states and (node_obj.provision_state in good_provision_states and
node_obj.instance_uuid is not None)): node_obj.instance_uuid is not None)):
continue continue

View File

@ -44,6 +44,12 @@ when the node was available for provisioning. During Kilo cycle, this was
changed to the AVAILABLE state. changed to the AVAILABLE state.
""" """
ENROLL = 'enroll'
""" Node is enrolled.
This state indicates that Ironic is aware of a node, but is not managing it.
"""
MANAGEABLE = 'manageable' MANAGEABLE = 'manageable'
""" Node is in a manageable state. """ Node is in a manageable state.
This state indicates that Ironic has verified, at least once, that it had This state indicates that Ironic has verified, at least once, that it had