diff --git a/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py index a93302d1611..bd9243ae16a 100644 --- a/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py +++ b/src/DIRAC/WorkloadManagementSystem/Utilities/PilotWrapper.py @@ -112,7 +112,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 ca6e28f0dc9..9685504854d 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