cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow question

Workflow question

Mark_ADRZ
New Contributor

Hi all,

 

I have create a workflow to query some switches and add the output to a file, in the next script of the flow I convert the file to a readable  format.
only if selected multiple switches than the convert script block runs multiple times.

is the away in a workflow to run a script without the devices? Like the email part of the flow only runs once.

so the cirkelt part needs to run after and only once

kind regards

Mark

 

1 ACCEPTED SOLUTION

Just for clarification, the device's variable applies to the entire workflow. TO let run a single activity, only one of many devices used you have to use another approach

use emc_vars['deviceIP'] to know the current device IP and emc_vars['devices'] where the list of all device IPs are contained. You can than check if the emc_vars['deviceIP'] in the first position of emc_vars['devices']  for let it run and all other have to stop the activity execution.

View solution in original post

6 REPLIES 6

Thx Markus !!!!
Ideed made a check if its the first device in list if so run the convert if not than skip convert.

 

kind regards Mark

 

def ifFirst():
    devices = emc_vars['devices'].replace('"','').replace(' ','')[1:-2].split(',')
    if emc_vars['deviceIP'] == devices[0]:
        return True
    else:
        return False

if ifFirst():
    print("do some execution")
else:
    print("stop")
GTM-P2G8KFN