[Top][All Lists]
[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: |
Jeff Forcier |
Subject: |
Re: [Fab-user] running a different command for each host in one task |
Date: |
Fri, 11 May 2012 10:54:30 -0700 |
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
--
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org