[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] env.hosts
From: |
Mike Zupan |
Subject: |
Re: [Fab-user] env.hosts |
Date: |
Mon, 30 Aug 2010 08:37:56 -0400 |
See the following
http://docs.fabfile.org/0.9.1/usage/execution.html
env.hosts most be set outside that function. It is so you can have
different environment settings.. think dev/staging/production.
So you could do
fab prod doit
or
fab dev doit
So you can set different hosts in
def prod():
and
def dev():
Or you can set your env outside the function
env.hosts = []
env.user = ""
def doit():
run("ls")
On Mon, Aug 30, 2010 at 7:43 AM, John Keyes <address@hidden> wrote:
> I ran the following command using Fabric 0.9.1:
>
> def doit():
> env.user = 'keyes'
> env.hosts = ['example.com']
> run('ls')
>
> and got the following output:
>
> No hosts found. Please specify (single) host string for connection:
>
> I changed the command to:
>
> def doit():
> env.user = 'keyes'
> env.host_string = 'example.com'
> run('ls')
>
> and the directory listing was printed to the console.
>
> The documentation always refers to the env.hosts setting but I cannot
> get that to work. Have I missed something?
>
> Thanks,
> -John
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>