Fix fetching ironic nodes for updating resource classes on upgrade

The correct value of "limit" to fetch all nodes is 0, not -1.
This issue prevents all nodes to be updated on upgrade, breaking scaling.

Change-Id: I1beac8fb463a6ecfaac3dc7f176d82beba7ffdc7
Closes-Bug: #1731885
(cherry picked from commit d106dda054)
This commit is contained in:
Dmitry Tantsur
2017-11-13 12:27:03 +01:00
parent de4dd54384
commit a599e4d423

View File

@@ -1426,7 +1426,7 @@ def _ensure_flavor(nova, existing, name, profile=None):
def _ensure_node_resource_classes(ironic):
for node in ironic.node.list(limit=-1, fields=['uuid', 'resource_class']):
for node in ironic.node.list(limit=0, fields=['uuid', 'resource_class']):
if node.resource_class:
if node.resource_class != DEFAULT_NODE_RESOURCE_CLASS:
LOG.warning('Node %s is using a resource class %s instead '