fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] problem with host_string/hosts (no hosts found)


From: Wawrzek Niewodniczanski
Subject: Re: [Fab-user] problem with host_string/hosts (no hosts found)
Date: Fri, 3 Oct 2014 11:19:55 +0100

On 3 October 2014 11:00, Carlos García <address@hidden> wrote:
Hi Wawrzek,


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.
 
Anyway, check out the documentation at http://docs.fabfile.org/en/latest/usage/execution.html#how-host-lists-are-constructed
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


--
Dr  Wawrzyniec Niewodniczański    or Wawrzek for short
  PhD in Quantum Chemistry  & MSc in Molecular Engineering          
   WWW: http://wawrzek.name E-MAIL: address@hidden
      Linux User #177124

reply via email to

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