Fix log from orphaned services to not say deleting when it's in dry run.

This commit is contained in:
IamTheFij 2023-10-19 12:08:28 -07:00
parent 2f3fc87f12
commit 48074bdc39

View File

@ -57,9 +57,11 @@ for namespace in nomad_req("services"):
except requests.exceptions.HTTPError as e: except requests.exceptions.HTTPError as e:
if e.response.status_code == 404: if e.response.status_code == 404:
alloc_found = False alloc_found = False
print( message = f"alloc {alloc_id} not found for {service_name}."
f"alloc {alloc_id} not found for {service_name}. Deleting {service_id}" if args.delete:
) message += f" Deleting {service_id}"
print(message)
else: else:
raise e raise e