def send(self, out_func): node_instance = workflow_ctx.get_node_instance(self._node_instance_id) logs.send_workflow_node_event( ctx=node_instance, event_type='workflow_node_event', message=self._event, additional_context=self._additional_context, out_func=out_func)
def __init__(self, instance=None, on_retry='reinstall', instance_id=None): if instance is None: instance = workflow_ctx.get_node_instance(instance_id) self.instance = instance if on_retry not in ('reinstall', 'uninstall'): raise exceptions.NonRecoverableError( 'on_retry must be reinstall or uninstall') self.on_retry = on_retry
def reinstall_node_instances(graph, node_instances, ignore_failure, related_nodes=None): uninstall_node_instances(graph, node_instances, ignore_failure, related_nodes, name_prefix='reinstall-') # refresh the local node instance references, because they most likely # changed their state & runtime props during the uninstall workflow_ctx.refresh_node_instances() node_instances = set( workflow_ctx.get_node_instance(inst.id) for inst in node_instances) related_nodes = set( workflow_ctx.get_node_instance(inst.id) for inst in related_nodes) install_node_instances(graph, node_instances, related_nodes, name_prefix='reinstall-')
def _send(self, out_func): node_instance = workflow_ctx.get_node_instance( self.kwargs['node_instance_id']) logs.send_workflow_node_event( ctx=node_instance, event_type='workflow_node_event', message=self.kwargs['event'], additional_context=self.kwargs['additional_context'], out_func=out_func, # if this operation is stored, we don't need to send the log, # because updating the operation state will insert the log # automatically, on the manager side skip_send=self.stored)
def __init__(self, instance=None, instance_id=None): if instance is None: instance = workflow_ctx.get_node_instance(instance_id) self.instance = instance