John Eikenberry wrote:
> 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 TrueOpps. Forgot to clean out that _quiet(). It just wraps the command in some contexts to shut up various output. > _______________________________________________ > Fab-user mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/fab-user -- John Eikenberry [ [email protected] - 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
signature.asc
Description: Digital signature
_______________________________________________ Fab-user mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/fab-user
