ensure VM IDs are unique before calling Azure reimage/delete APIs (#1023)

This commit is contained in:
bmc-msft
2021-06-25 11:54:52 -04:00
committed by GitHub
parent 880039a617
commit 883c93aaf4
2 changed files with 15 additions and 13 deletions

View File

@ -537,7 +537,7 @@ class Scaleset(BASE_SCALESET, ORMMixin):
)
return
machine_ids = []
machine_ids = set()
for node in nodes:
if node.debug_keep_node:
logging.warning(
@ -547,7 +547,7 @@ class Scaleset(BASE_SCALESET, ORMMixin):
node.machine_id,
)
else:
machine_ids.append(node.machine_id)
machine_ids.add(node.machine_id)
logging.info(
SCALESET_LOG_PREFIX + "deleting nodes scaleset_id:%s machine_id:%s",
@ -585,7 +585,7 @@ class Scaleset(BASE_SCALESET, ORMMixin):
)
return
machine_ids = []
machine_ids = set()
for node in nodes:
if node.debug_keep_node:
logging.warning(
@ -595,7 +595,7 @@ class Scaleset(BASE_SCALESET, ORMMixin):
node.machine_id,
)
else:
machine_ids.append(node.machine_id)
machine_ids.add(node.machine_id)
if not machine_ids:
logging.info(