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
1 changed files with 5 additions and 3 deletions

View File

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