From 0cdf506db8a9f47698129b5c8f52b66f53429818 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 14 Sep 2023 12:16:22 -0500 Subject: [PATCH] fix: allow for uid without username Since 1.26 (ab9a96e66ac1df6a7b3989b082c043932b77dd33) we are seeing `ddsim` exceptions on certain Open Science Grid nodes/sites. Those sites appear to configure the running of singularity containers in such a way that no usernames are associated with the uid. --- DDG4/python/DDSim/Helper/Meta.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DDG4/python/DDSim/Helper/Meta.py b/DDG4/python/DDSim/Helper/Meta.py index 7b1e2f2e9..45b406da8 100644 --- a/DDG4/python/DDSim/Helper/Meta.py +++ b/DDG4/python/DDSim/Helper/Meta.py @@ -100,6 +100,9 @@ def addParametersToRunHeader(sim): # add User import getpass - runHeader["User"] = getpass.getuser() + try: + runHeader["User"] = getpass.getuser() + except KeyError: + runHeader["User"] = str(os.getuid()) return runHeader