From 7f94e3fc77f8f4ae290c5429d53f826fa8707268 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 1 Nov 2019 21:09:15 -0500 Subject: [PATCH] Tweak a method signature for batch views sometimes executing a batch will involve an "action" kwarg, so we can't use that or else a collision ensues --- tailbone/views/batch/core.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tailbone/views/batch/core.py b/tailbone/views/batch/core.py index fbdff369..3f30ed3d 100644 --- a/tailbone/views/batch/core.py +++ b/tailbone/views/batch/core.py @@ -959,7 +959,7 @@ class BatchMasterView(MasterView): log.debug("launching command in subprocess: %s", cmd) subprocess.check_call(cmd) - def action_subprocess_thread(self, batch_uuid, port, username, action, progress, **kwargs): + def action_subprocess_thread(self, batch_uuid, port, username, handler_action, progress, **kwargs): """ This method is sort of an alternative thread target for batch actions, to be used in the event versioning is enabled for the main process but @@ -973,7 +973,7 @@ class BatchMasterView(MasterView): self.handler.batch_key, batch_uuid, ] - if action == 'execute' and kwargs: + if handler_action == 'execute' and kwargs: subargs.extend([ '--kwargs', json.dumps(kwargs), @@ -986,10 +986,10 @@ class BatchMasterView(MasterView): command_args=[ '--no-versioning', ], - subcommand='{}-batch'.format(action), + subcommand='{}-batch'.format(handler_action), subcommand_args=subargs) except Exception as error: - log.warning("%s of '%s' batch failed: %s", action, self.handler.batch_key, batch_uuid, exc_info=True) + log.warning("%s of '%s' batch failed: %s", handler_action, self.handler.batch_key, batch_uuid, exc_info=True) # TODO: write error info to socket @@ -1001,7 +1001,7 @@ class BatchMasterView(MasterView): return - models = getattr(self.handler, 'version_catchup_{}'.format(action), None) + models = getattr(self.handler, 'version_catchup_{}'.format(handler_action), None) if models: self.catchup_versions(port, batch_uuid, username, *models)