From eeefed050324f551d467cd9296ef5b86645793f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jord=C3=A0=20Polo?= Date: Fri, 3 Jan 2025 16:21:04 -0800 Subject: [PATCH] Make sure squeue isn't timing out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jordà Polo --- omnistat/collector_rms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/omnistat/collector_rms.py b/omnistat/collector_rms.py index 05fd81c..c0d5b0b 100644 --- a/omnistat/collector_rms.py +++ b/omnistat/collector_rms.py @@ -98,7 +98,7 @@ def querySlurmJob(self, timeout=1, exit_on_error=False, mode="squeue"): if mode == "squeue": data = utils.runShellCommand(self.__squeue_query, timeout=timeout, exit_on_error=exit_on_error) # squeue query output format: JOBID:USER:PARTITION:NUM_NODES:BATCHFLAG - if data.stdout.strip(): + if data and data.stdout.strip(): data = data.stdout.strip().split(":") keys = [ "RMS_JOB_ID", @@ -113,7 +113,7 @@ def querySlurmJob(self, timeout=1, exit_on_error=False, mode="squeue"): # require a 2nd query to ascertain job steps (otherwise, miss out on batchflag) data = utils.runShellCommand(self.__squeue_steps, timeout=timeout, exit_on_error=exit_on_error) results["RMS_STEP_ID"] = -1 - if data.stdout.strip(): + if data and data.stdout.strip(): # If we are in an active job step, the STEPID will have an integer index appended, e.g. # 57735.10 # 57735.interactive