how to dynamically add step to workflow

asked 2016-08-22 14:29:53 -0500

chiragtayal gravatar image

I am trying to dynamically add a step to workflow based on running status of linux service.

I added code in overrides.py file to override "create network" based on the check if da_server service is running, when service is running I can see the step in the workflow but when I disable the service still I see the step

output = subprocess.check_output(['ps', '-ef'])

if 'da_server' in output:

horizon_network_workflows.CreateNetwork.default_steps = \
    network_workflows.DACreateNetwork.default_steps
horizon_network_workflows.CreateNetwork.handle = \
    network_workflows.DACreateNetwork.handle
horizon_network_workflows.CreateNetwork._create_network = \
    network_workflows.DACreateNetwork._create_network
edit retag flag offensive close merge delete