On 3 October 2014 11:00, Carlos García
<address@hidden> wrote:
Hello Carlos,
if you need to specify a host per task, I would recommend you to use the @hosts decorator:
I have a list for many hosts, but choose to present an example with 'localhost' because it works everywhere.
@hosts('localhost')
def test():
print "Hosts:", env['hosts']
print "Host_string", env['host_string']
run('uname -a')
Thanks for suggestion - it does neither work. I'm not surprise - 'hosts'
is not a problem. It is set up correctly, but somehow host_string ins
not properly set up for a function.
It explains how the hosts lists are constructed and how can you use it. I usually use the -H flag in the fab command.
Based
on documentation (which I've been molesting since I hit a problem)
somehow fabric doesn't properly iterate over env.hosts. Maybe I have a
take a look into sources.
Thanks,
Wawrzek