fab-user
[Top][All Lists]
Advanced

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

[Fab-user] Finding out which hosts are alive


From: Paul Hoffman
Subject: [Fab-user] Finding out which hosts are alive
Date: Tue, 15 Sep 2015 16:52:04 -0700

Greetings. I want a script to do an update to all of the hosts that are alive, but not spend time on ones that aren't. I tried the following as a way of filling env.hosts:

@hosts("address@hidden", "address@hidden")
def PickHosts():
    PickAttempt = run("echo")
    if PickAttempt.succeeded:
        (env.hosts).append(env.host_string)
        print("Adding {}".format(env.host_string))
PickHosts()

def DoTheUpdates(): ...

However, running this with a command line of "fab DoTheUpdates", prompts:
   No hosts found. Please specify (single) host string for connection:

How can I get the above code to work? Or if this is too much of a kludge, what is the proper way to have DoTheUpdates try a bunch of hosts but gracefully stop each time it can't log into one?

--Paul Hoffman

reply via email to

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