Merge "Fix node delete for unprovision confirmation" into stable/wallaby

This commit is contained in:
Zuul 2022-05-04 01:54:18 +00:00 committed by Gerrit Code Review
commit c2a57742d6
2 changed files with 9 additions and 2 deletions

View File

@ -273,7 +273,8 @@ class TestDeleteNode(fakes.TestDeleteNode):
}],
'name': 'Controller'
}],
'prompt': False
'prompt': False,
'manage_network_ports': True
},
)
])

View File

@ -97,7 +97,12 @@ class DeleteNode(command.Command):
}
)
with open(unprovision_confirm) as f:
nodes = json.load(f)
to_unprovision = json.load(f)
if isinstance(to_unprovision, dict):
nodes = to_unprovision.get(
'instances') + to_unprovision.get('pre_provisioned')
else:
nodes = to_unprovision
if not nodes:
print('No nodes to unprovision')
return None, None
@ -192,6 +197,7 @@ class DeleteNode(command.Command):
"stack_name": parsed_args.stack,
"baremetal_deployment": roles,
"prompt": False,
"manage_network_ports": True,
}
)