fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] running parallel executions with different env.user


From: Stephen Barrett
Subject: [Fab-user] running parallel executions with different env.user
Date: Thu, 9 Nov 2017 20:00:24 +0000

Hello,

 

I’m looking to update a package that uses fabric to interact with a bunch of windows slaves (Cygwin sshd) to do things in parallel. Unfortunately I can’t work out how to have fabric use a different env.user for each host, because sadly the hosts require <machinename>+<username> as their login credentials.

 

For example how would I update this code to run things in parallel for each host?

 

deployables = init_deployables(release)

    # API kill first

    hosts = set([options['host'] for options in deployables.values()])

    api_killed = False

    for host in hosts:

        env.user = "{}+autobot".format(host.upper())

        api_killed = execute(apikill_apps, host=host)[host] or api_killed

 

    if api_killed:

        print "Sleeping 20 seconds to let apps shutdown before attempting to task kill remainders"

        sleep(20)

 

    # Cleanup everything remaining with taskkill

    for host in hosts:

        env.user = "{}+autobot".format(host.upper())

        execute(taskkill_apps, host=host)

 

Thanks!

 

Stephen Barrett

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]