diff --git a/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py index 76fa79ffd66..b22c70d9eed 100644 --- a/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py @@ -156,7 +156,7 @@ def pilotWrapperScript( if envVariables is None: envVariables = {} - if CVMFS_locations is None: + if not CVMFS_locations: # What is in this location is almost certainly incorrect, especially the pilot.json CVMFS_locs = '["file:/cvmfs/dirac.egi.eu/pilot"]' else: diff --git a/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py index bb7a569e06d..8b4a29f0e33 100644 --- a/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/test/Test_PilotWrapper.py @@ -121,3 +121,18 @@ def test_scriptPilot3_3(): """locations += ["file:/cvmfs/lhcb.cern.ch/lhcbdirac/pilot","file:/cvmfs/dirac.egi.eu/lhcbdirac/pilot"]""" in res ) + + +def test_scriptPilot3_4(): + """test script creation""" + res = pilotWrapperScript( + pilotFilesCompressedEncodedDict={"proxy": "thisIsSomeProxy"}, + pilotOptions="-c 123 --foo bar -l LHCb -h pippo", + envVariables={"someName": "someValue", "someMore": "oneMore"}, + location="lhcb-portal.cern.ch", + CVMFS_locations=[], + ) + + assert 'os.environ["someName"]="someValue"' in res + assert "lhcb-portal.cern.ch" in res + assert """locations += ["file:/cvmfs/dirac.egi.eu/pilot"]""" in res