fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Populating env.hosts?


From: Xavier Ordoquy
Subject: Re: [Fab-user] Populating env.hosts?
Date: Mon, 7 Feb 2011 11:21:22 +0100

Hi there,

You'll also need to define env.host_string for each of your host.
Fabric automatically populate it when called from command line but not within a 
python script.

Regards,
Xavier.

Le 7 févr. 2011 à 11:00, address@hidden a écrit :

> Hi
> 
> Anyone have any idea why this does not work? If I print env.hosts out,
> all the ip's are there perfectly. For example : env.hosts
> ['192.168.1.1', '192.168.1.2', '192.168.1.3']
> 
> However when I run my fabric script, I get
> 
> No hosts found. Please specify (single) host string for connection:
> 
> def servers():
> 
> """
> servers()
> 
> Gets a list of servers to populate env.hosts.
> """
> 
> env.hosts = []
> 
> for server_name in config.options('Servers'):
>   ip_address = config.get('Servers', server_name)
>   env.hosts.append(ip_address)
> 
> print "env.hosts %s" % env.hosts
> env.user = 'deployboy'
> env.key_filename = [ './secret.pem' ]
> run('hostname')
> 
> End - servers
> 
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user




reply via email to

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