in securedrop_salt/remove-tags.py [0:0]
def main():
tags_removed = False
for vm in q.domains:
for tag in TAGS_TO_REMOVE:
if tag in q.domains[vm].tags:
print(f"Removing tag '{tag}' from VM '{vm}'.")
try:
q.domains[vm].tags.remove(tag)
except Exception as error:
print(f"Error removing tag: '{error}'")
print("Aborting.")
sys.exit(1)
tags_removed = True
if tags_removed is False:
print(f"Tags {TAGS_TO_REMOVE} not set on any VMs, nothing removed.")