Add error message if no bare metal nodes available
Change-Id: I3be30ed8bb61d8ed514991a2f55c5c4e36c56411
Closes-Bug: 1703942
(cherry picked from commit 6d3ce6329d
)
This commit is contained in:
parent
2517e1ef81
commit
d83dbb9b3c
|
@ -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.
|
|
@ -331,6 +331,16 @@ class VerifyProfilesAction(base.TripleOAction):
|
||||||
|
|
||||||
bm_nodes = {node['uuid']: node for node in self.nodes
|
bm_nodes = {node['uuid']: node for node in self.nodes
|
||||||
if node['provision_state'] in ('available', 'active')}
|
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)
|
free_node_caps = {uu: self._node_get_capabilities(node)
|
||||||
for uu, node in bm_nodes.items()}
|
for uu, node in bm_nodes.items()}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue