From dc6f1cc80d0a5d2e513d40b10d43f77287069160 Mon Sep 17 00:00:00 2001 From: Kelly McDonald Date: Wed, 28 Apr 2021 10:03:52 -0400 Subject: [PATCH] Emulate checks on keyword arguments and then return. Validate only should have no side effects so the previous behavior was a bug. --- crc/scripts/file_data_get.py | 4 +++- crc/scripts/file_data_set.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crc/scripts/file_data_get.py b/crc/scripts/file_data_get.py index 4fa2ca5b..edd060be 100644 --- a/crc/scripts/file_data_get.py +++ b/crc/scripts/file_data_get.py @@ -10,7 +10,9 @@ class FileDataGet(Script, DataStoreBase): return """Gets user data from the data store - takes only two keyword arguments arguments: 'file_id' and 'key' """ def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): - self.do_task(task, study_id, workflow_id, *args, **kwargs) + if self.validate_kw_args(**kwargs): + myargs = [kwargs['key']] + return True def validate_kw_args(self,**kwargs): if kwargs.get('key',None) is None: diff --git a/crc/scripts/file_data_set.py b/crc/scripts/file_data_set.py index 8c5d0a49..99cbdd45 100644 --- a/crc/scripts/file_data_set.py +++ b/crc/scripts/file_data_set.py @@ -10,7 +10,11 @@ class FileDataSet(Script, DataStoreBase): return """Sets data the data store - takes three keyword arguments arguments: 'file_id' and 'key' and 'value'""" def do_task_validate_only(self, task, study_id, workflow_id, *args, **kwargs): - self.do_task(task, study_id, workflow_id, *args, **kwargs) + if self.validate_kw_args(**kwargs): + myargs = [kwargs['key'],kwargs['value']] + fileid = kwargs['file_id'] + del(kwargs['file_id']) + return True def validate_kw_args(self,**kwargs): if kwargs.get('key',None) is None: