Skip to content

Commit

Permalink
fixing abort-functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
heikoklein committed Dec 18, 2017
1 parent 5b3096b commit 2178af2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/SnapPy/Snappy/EEMEP/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ def cancel_first_in_queue(self, qDict):
try:
self.write_log("trying to abort {}".format(dirpath))
abortLogFile = datetime.datetime.now().strftime('{fname}_%Y%m%d-%H%M%S').format(fname=ModelRunner.ABORT_FILENAME)
with open(os.path.join(dirpath, abortLogFile)) as lh:
with open(os.path.join(dirpath, abortLogFile), 'wt') as lh:
lh.write("aborted by {}".format(getpass.getuser()))
os.remove(os.path.join(dirpath, file))
except:
traceback.print_exc()
self.write_log("abort not succeeded".format(dirpath))
pass

Expand Down

0 comments on commit 2178af2

Please sign in to comment.