fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] running a different command for each host in one task


From: Comète
Subject: Re: [Fab-user] running a different command for each host in one task
Date: Fri, 11 May 2012 21:16:59 +0200
User-agent: Roundcube Webmail/0.7.2

Hi,

thanks to Jeff, Marcelo and Peter for the help ;)

the answer was indeed to use "execute" as you told me and it works !

Thanks again guys !


Morgan

Le 11-05-2012 19:54, Jeff Forcier a écrit :
Hi Morgan,

You just need to use the execute() function, which allows you to run
any task/function on any host/list of hosts/etc. See:



http://docs.fabfile.org/en/1.4.2/usage/execution.html#intelligently-executing-tasks-with-execute

It will even look at the @hosts decorators if you are using them, so
all you should have to do is change is_it_blocked() to:

    @task
    def is_it_blocked():
        """Verifie si un mail est bloqué sur firewall ou la
passerelle SMTP"""
   address = raw_input("Entrez l'adresse ou mot clé à rechercher: ")
        execute(ask_fw, address)
        execute(ask_smtp, address)

HTH,
Jeff




reply via email to

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