fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] how to skip unreachable hosts


From: John Eikenberry
Subject: Re: [Fab-user] how to skip unreachable hosts
Date: Thu, 20 Oct 2011 11:34:07 -0700
User-agent: Mutt/1.5.21 (2010-09-15)

Nicolas Michel wrote:

> Hello,
> 
> I have some roles where sometimes hosts are unreachable. For now the fab
> tool exit the loop and don't execute the code on further hosts of my role
> list.
> Is there a way to avoid that behavior, set a kind of timeout and skip the
> host if fab can't connect to it?

If you can work it into your code, it is easy to do manually.

def online(host):
    """ Is host reachable on the network?
    """
    if _quiet(fab.local)("ping -c 1 -W 1 %s" % host).failed:
        return False
    return True

-- 

John Eikenberry
[ address@hidden - http://zhar.net ]
[ PGP public key @ http://zhar.net/jae_at_zhar_net.gpg ]
________________________________________________________________________
"Perfection is attained, not when no more can be added, but when no more
 can be removed." -- Antoine de Saint-Exupery

Attachment: signature.asc
Description: Digital signature


reply via email to

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