From 3c60bb9c025ab95e442f4d7388fde804076c8f0f Mon Sep 17 00:00:00 2001 From: hafsanaeem-2 Date: Wed, 30 Nov 2022 01:35:10 +0000 Subject: [PATCH] determine_user --- eessi_bot_job_manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eessi_bot_job_manager.py b/eessi_bot_job_manager.py index a976f492..f6ab70fb 100644 --- a/eessi_bot_job_manager.py +++ b/eessi_bot_job_manager.py @@ -53,7 +53,9 @@ def __init__(self): def get_current_jobs(self): # who am i - username = os.getlogin() + username = os.getenv('USER', None) + if username is None: + raise Exception("Unable to find username") squeue_cmd = "%s --long --user=%s" % (self.poll_command, username) squeue_output, squeue_err, squeue_exitcode = run_cmd(