Merge "Do not try to "provide" updated nodes not in "manageable" state"

This commit is contained in:
Jenkins 2016-11-08 12:27:59 +00:00 committed by Gerrit Code Review
commit b188c70e63
2 changed files with 10 additions and 5 deletions

View File

@ -338,9 +338,10 @@ pxe_ssh,192.168.122.2,stack,"KEY2",00:0b:d0:69:7e:58""")
)
self.mock_websocket_success = [{
"status": "SUCCESS",
"registered_nodes": [{
"uuid": "MOCK_NODE_UUID"
}],
"registered_nodes": [
{"uuid": "MOCK_NODE_UUID", "provision_state": "manageable"},
{"uuid": "MOCK_NODE_UUID2", "provision_state": "available"},
],
}, {
"status": "SUCCESS"
}]

View File

@ -190,9 +190,13 @@ class ImportBaremetal(command.Command):
instance_boot_option=parsed_args.instance_boot_option
)
node_uuids = [node['uuid'] for node in nodes]
if parsed_args.initial_state == "available":
# NOTE(dtantsur): newly enrolled nodes state is reported as
# "enroll" from the workflow even though it's actually "manageable"
# because the node list is built before "manage" action is run.
node_uuids = [node['uuid'] for node in nodes
if node['provision_state'] in {'manageable',
'enroll'}]
baremetal.provide(self.app.client_manager, node_uuids=node_uuids,
queue_name=queue_name)