Skip to content

Commit b9789ab

Browse files
author
Robin VAN DE MERGHEL
committed
fix: Some minor fixes
1 parent ecfb47b commit b9789ab

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

Pilot/dirac-pilot.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
if not sys.stdin.isatty():
7878
receivedContent = sys.stdin.read()
7979
log = RemoteLogger(
80-
pilotParams.loggerUR,
80+
pilotParams.loggerURL,
8181
"Pilot",
8282
bufsize=pilotParams.loggerBufsize,
8383
pilotUUID=pilotParams.pilotUUID,
@@ -95,7 +95,7 @@
9595
pythonPathCheck()
9696
else:
9797
log.info("Clearing PYTHONPATH for child processes.")
98-
if "PYTHONPATH" in os.environ:
98+
if "PYTHONPATH" in os.environ:
9999
os.environ["PYTHONPATH_SAVE"] = os.environ["PYTHONPATH"]
100100
os.environ["PYTHONPATH"] = ""
101101

@@ -138,7 +138,7 @@
138138

139139
if pilotParams.jwt:
140140
if remote:
141-
log.buffer.flush(force=True)
141+
log.buffer.flush()
142142

143143
log.info("Revoking pilot token.")
144144
revokePilotToken(

Pilot/pilotCommands.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def __init__(self, pilotParams):
4343
from shlex import quote
4444
except ImportError:
4545
from pipes import quote
46-
4746
try:
4847
from Pilot.pilotTools import (
4948
CommandBase,
@@ -101,7 +100,6 @@ def wrapper(self):
101100
# unexpected exit: document it and bail out.
102101
self.log.error(str(exc))
103102
self.log.error(traceback.format_exc())
104-
105103
raise
106104
finally:
107105
self.log.buffer.cancelTimer()
@@ -132,7 +130,6 @@ def __init__(self, pilotParams):
132130
@logFinalizer
133131
def execute(self):
134132
"""Get host and local user info, and other basic checks, e.g. space available"""
135-
136133
self.log.info("Uname = %s" % " ".join(os.uname()))
137134
self.log.info("Host Name = %s" % socket.gethostname())
138135
self.log.info("Host FQDN = %s" % socket.getfqdn())
@@ -1229,6 +1226,4 @@ def _runNagiosProbes(self):
12291226
def execute(self):
12301227
"""Standard entry point to a pilot command"""
12311228
self._setNagiosOptions()
1232-
self._runNagiosProbes()
1233-
1234-
1229+
self._runNagiosProbes()

Pilot/proxyTools.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
from __future__ import absolute_import, division, print_function
44

5-
from curses import raw
65
import json
7-
from multiprocessing import Value
86
import os
97
import time
108
import re

Pilot/tests/Test_simplePilotLogger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def test_pilotParamsInit(self, argvmock):
4343
argvmock.__getitem__.assert_called()
4444
self.assertEqual(argvmock.__getitem__.call_count, 2) # 2 getopt calls
4545
self.assertTrue(pp.pilotLogging)
46+
self.assertEqual(pp.loggerURL, "dummyURL")
4647
self.assertTrue(pp.debugFlag)
4748

4849
def test_getOptionForPaths(self):
@@ -104,6 +105,7 @@ def test_pilotOptions(self, argvmock, mockPaths):
104105
res = pp.getPilotOptionsDict()
105106
logURL = "https://lbcertifdirac70.cern.ch:8443/WorkloadManagement/TornadoPilotLogging"
106107
self.assertEqual(res.get("RemoteLoggerURL"), logURL)
108+
self.assertEqual(pp.loggerURL, logURL)
107109
self.assertEqual(res.get("RemoteLogging"), "False")
108110
self.assertIs(pp.pilotLogging, False)
109111
self.assertEqual(res.get("UploadPath"), "/gridpp/pilotlogs/")

0 commit comments

Comments
 (0)