Guard against getuser() and getfqdn() failing
@@ -508,11 +508,16 @@ rule branching_process_R0:
--output {output[1]}
"""
+try:
deploy_origin = (
f"from AWS Batch job `{environ['AWS_BATCH_JOB_ID']}`"
if environ.get("AWS_BATCH_JOB_ID") else
f"by the hands of {getuser()}@{getfqdn()}"
)
+except:
+ # getuser() and getfqdn() may not always succeed, and this catch-all except
+ # means that the Snakefile won't crash.
+ deploy_origin = "by an unknown identity"
rule deploy_to_staging:
input:
