diff --git a/scripts/nomad_orphan_services.py b/scripts/nomad_orphan_services.py index 76b4406..bba82a7 100755 --- a/scripts/nomad_orphan_services.py +++ b/scripts/nomad_orphan_services.py @@ -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