Skip to content

Commit

Permalink
sweep: DIRACGrid#7138 dirac_production_runjoblocal fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni authored and web-flow committed Aug 1, 2023
1 parent 1ce2827 commit 142094e
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ def __downloadPilotScripts():
"dirac-pilot.py",
"pilotCommands.py",
"pilotTools",
"MessageSender",
"PilotLogger.py",
"PilotLoggerTools.py",
]:
remoteFile = urlopen(
os.path.join("https://raw.githubusercontent.com/DIRACGrid/Pilot/master/Pilot/", fileName),
Expand Down Expand Up @@ -95,7 +92,7 @@ def __configurePilot(basepath, vo):
diracdir = os.path.expanduser("~") + os.path.sep
try:
os.rename(diracdir + ".dirac.cfg", diracdir + ".dirac.cfg.old")
except OSError:
except (OSError, FileNotFoundError):
pass
shutil.copyfile(diracdir + "pilot.cfg", diracdir + ".dirac.cfg")

Expand Down Expand Up @@ -146,7 +143,10 @@ def main():
__runJobLocally(_jobID, _path, _vo)
finally:
os.chdir(_dir)
os.rename(_dir + ".dirac.cfg.old", _dir + ".dirac.cfg")
try:
os.rename(_dir + ".dirac.cfg.old", _dir + ".dirac.cfg")
except FileNotFoundError:
pass


if __name__ == "__main__":
Expand Down

0 comments on commit 142094e

Please sign in to comment.