From c33f0b5e4d11170bbf0977ebf8f68db693cf6dd4 Mon Sep 17 00:00:00 2001 From: bud42 Date: Tue, 3 Mar 2020 00:27:44 -0500 Subject: [PATCH] Handle empty args --- dax/dax_manager.py | 5 +++-- dax/task.py | 7 ++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dax/dax_manager.py b/dax/dax_manager.py index 91c76b7f..762acb03 100644 --- a/dax/dax_manager.py +++ b/dax/dax_manager.py @@ -265,8 +265,9 @@ def load_module_record(self, module, project): dax_rec['filepath'] = rc_rec[file_key] # Parse arguments - if rc_rec[key_prefix + '_args']: - rlist = rc_rec[key_prefix + '_args'].strip().split('\r\n') + args_key = key_prefix + '_args' + if rc_rec[args_key] and len(rc_rec[args_key]) > 0: + rlist = rc_rec[args_key].strip().split('\r\n') rdict = {} for arg in rlist: key, val = arg.split(':', 1) diff --git a/dax/task.py b/dax/task.py index d2bbc028..cd5576a8 100644 --- a/dax/task.py +++ b/dax/task.py @@ -1348,9 +1348,10 @@ def complete_task(self): # Move output file src = self.outlog_path() dst = self.upload_outlog_dir() - mkdirp(dst) - LOGGER.debug('moving outlog file from %s to %s' % (src, dst)) - shutil.move(src, dst) + if os.path.exists(src): + mkdirp(dst) + LOGGER.debug('moving outlog file from %s to %s' % (src, dst)) + shutil.move(src, dst) # Touch file for dax_upload to check create_flag(os.path.join(RESULTS_DIR, self.assessor_label,