diff --git a/Pilot/dirac-pilot.py b/Pilot/dirac-pilot.py index 001b819f..676bc197 100644 --- a/Pilot/dirac-pilot.py +++ b/Pilot/dirac-pilot.py @@ -70,7 +70,8 @@ if not sys.stdin.isatty(): receivedContent = sys.stdin.read() log = RemoteLogger( - pilotParams.loggerURL, "Pilot", bufsize=pilotParams.loggerBufsize, pilotUUID=pilotParams.pilotUUID, debugFlag=pilotParams.debugFlag + pilotParams.loggerURL, "Pilot", bufsize=pilotParams.loggerBufsize, + pilotUUID=pilotParams.pilotUUID, debugFlag=pilotParams.debugFlag, wnVO=pilotParams.wnVO, ) log.info("Remote logger activated") log.buffer.write(receivedContent) diff --git a/Pilot/pilotTools.py b/Pilot/pilotTools.py index 17096fd0..50380503 100644 --- a/Pilot/pilotTools.py +++ b/Pilot/pilotTools.py @@ -513,6 +513,7 @@ def __init__( pilotUUID="unknown", flushInterval=10, bufsize=1000, + wnVO = "unknown", ): """ c'tor @@ -523,7 +524,7 @@ def __init__( self.url = url self.pilotUUID = pilotUUID self.isPilotLoggerOn = isPilotLoggerOn - sendToURL = partial(sendMessage, url, pilotUUID, "sendMessage") + sendToURL = partial(sendMessage, url, pilotUUID, wnVO, "sendMessage") self.buffer = FixedSizeBuffer(sendToURL, bufsize=bufsize, autoflush=flushInterval) def debug(self, msg, header=True, sendPilotLog=False): @@ -668,12 +669,13 @@ def cancelTimer(self): self._timer.cancel() -def sendMessage(url, pilotUUID, method, rawMessage): +def sendMessage(url, pilotUUID, wnVO, method, rawMessage): """ Invoke a remote method on a Tornado server and pass a JSON message to it. :param str url: Server URL :param str pilotUUID: pilot unique ID + :param str wnVO: VO name, relevant only if not contained in a proxy :param str method: a method to be invoked :param str rawMessage: a message to be sent, in JSON format :return: None. @@ -684,7 +686,7 @@ def sendMessage(url, pilotUUID, method, rawMessage): context = ssl.create_default_context() context.load_verify_locations(capath=caPath) - message = json.dumps((json.dumps(rawMessage), pilotUUID)) + message = json.dumps((json.dumps(rawMessage), pilotUUID, wnVO)) try: context.load_cert_chain(cert) # this is a proxy @@ -737,6 +739,7 @@ def __init__(self, pilotParams, dummy=""): debugFlag=self.debugFlag, flushInterval=interval, bufsize=bufsize, + wnVO=pilotParams.wnVO, ) self.log.isPilotLoggerOn = isPilotLoggerOn