metalsmith_instances: Handle an empty instance list
The dynamic concurrency change[1] causes an issue when the instance list is empty because the thread pool is created with max_workers=0. This change avoids this issue by exiting the provision function early if the instances list is empty. [1] https://review.opendev.org/#/c/714735/ Change-Id: I0d3587b575b0d32563ef24c7b1316c0b173a4268
This commit is contained in:
parent
97a5e83565
commit
22e3522824
|
@ -235,6 +235,9 @@ def _release_nodes(provisioner, node_ids):
|
||||||
|
|
||||||
|
|
||||||
def provision(provisioner, instances, timeout, concurrency, clean_up, wait):
|
def provision(provisioner, instances, timeout, concurrency, clean_up, wait):
|
||||||
|
if not instances:
|
||||||
|
return False, []
|
||||||
|
|
||||||
# first, ensure all instances are reserved
|
# first, ensure all instances are reserved
|
||||||
reserve(provisioner, [i for i in instances if not i.get('name')], clean_up)
|
reserve(provisioner, [i for i in instances if not i.get('name')], clean_up)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue