diff --git a/releasenotes/notes/error-msg-no-baremetal-a583117ecd9836dc.yaml b/releasenotes/notes/error-msg-no-baremetal-a583117ecd9836dc.yaml new file mode 100644 index 000000000..9bb0908e6 --- /dev/null +++ b/releasenotes/notes/error-msg-no-baremetal-a583117ecd9836dc.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Add an error message if there are no bare metal nodes available in an + available or active state and with maintenance mode off. Previously, + the message was misleading about missing control or compute flavor + having no profile associated. diff --git a/tripleo_common/actions/validations.py b/tripleo_common/actions/validations.py index 13c467a43..017f99de0 100644 --- a/tripleo_common/actions/validations.py +++ b/tripleo_common/actions/validations.py @@ -331,6 +331,16 @@ class VerifyProfilesAction(base.TripleOAction): bm_nodes = {node['uuid']: node for node in self.nodes if node['provision_state'] in ('available', 'active')} + + if not bm_nodes: + message = ('Error: There are no nodes in an available ' + 'or active state and with maintenance mode off.') + return_value = { + 'errors': [message], + 'warnings': [], + } + return actions.Result(error=return_value) + free_node_caps = {uu: self._node_get_capabilities(node) for uu, node in bm_nodes.items()}