From 5c3f3d00489ec12513b7b2794625d3206fc78081 Mon Sep 17 00:00:00 2001 From: Chris Burr Date: Thu, 25 Aug 2022 11:03:09 +0200 Subject: [PATCH] fix: Strip new lines before parsing output for more DIRAC commands --- Pilot/pilotCommands.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Pilot/pilotCommands.py b/Pilot/pilotCommands.py index 8f52e8ce..a79ccc43 100644 --- a/Pilot/pilotCommands.py +++ b/Pilot/pilotCommands.py @@ -578,7 +578,7 @@ def execute(self): self.exitWithError(retCode) try: - result = result.split("\n")[-1].split(" ") + result = result.strip().split("\n")[-1].split(" ") numberOfProcessorsOnWN = int(result[0]) maxRAM = int(result[1]) try: @@ -846,7 +846,7 @@ def execute(self): if retCode: self.log.error("There was an error updating the platform [ERROR %d]" % retCode) self.exitWithError(retCode) - self.log.info("Architecture determined: %s" % localArchitecture.split("\n")[-1]) + self.log.info("Architecture determined: %s" % localArchitecture.strip().split("\n")[-1]) # standard options cfg = ["-FDMH"] # force update, skip CA checks, skip CA download, skip VOMS @@ -861,7 +861,7 @@ def execute(self): cfg.append("-ddd") # real options added here - localArchitecture = localArchitecture.split("\n")[-1].strip() + localArchitecture = localArchitecture.strip().split("\n")[-1].strip() cfg.append('-S "%s"' % self.pp.setup) cfg.append("-o /LocalSite/Architecture=%s" % localArchitecture)