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
This commit is contained in:
Lance Edgar 2019-11-01 21:09:15 -05:00
parent 8af3d53a3c
commit 7f94e3fc77

View file

@ -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)