From 61e640e6b1856372faf8a2056a2c14980def5c23 Mon Sep 17 00:00:00 2001 From: Janusz Martyniak Date: Tue, 23 Jan 2024 17:48:49 +0100 Subject: [PATCH] fix: add a CE whitelist for remote logging (fix None type) --- Pilot/pilotTools.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Pilot/pilotTools.py b/Pilot/pilotTools.py index d71f3baf..8433ffa6 100644 --- a/Pilot/pilotTools.py +++ b/Pilot/pilotTools.py @@ -1224,12 +1224,13 @@ def __initJSON2(self): # logger CE white list loggerCEsWhiteList = pilotOptions.get("RemoteLoggerCEsWhiteList", None) # restrict remote logging to a whitelisted CEs ([] => no restriction) - if not isinstance(loggerCEsWhiteList, list): - loggerCEsWhiteList = [elem.strip() for elem in loggerCEsWhiteList.split(",")] self.log.debug("JSON: Remote logging CE white list: %s" % loggerCEsWhiteList) - if loggerCEsWhiteList is not None and self.ceName not in loggerCEsWhiteList: - self.pilotLogging = False - self.log.debug("JSON: Remote logging disabled for this CE: %s" % self.ceName) + if loggerCEsWhiteList is not None: + if not isinstance(loggerCEsWhiteList, list): + loggerCEsWhiteList = [elem.strip() for elem in loggerCEsWhiteList.split(",")] + if self.ceName not in loggerCEsWhiteList: + self.pilotLogging = False + self.log.debug("JSON: Remote logging disabled for this CE: %s" % self.ceName) pilotLogLevel = pilotOptions.get("PilotLogLevel", "INFO") if pilotLogLevel.lower() == "debug": self.debugFlag = True