[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Fab-user] Calling Fabric from Python
From: |
Xavier Ordoquy |
Subject: |
Re: [Fab-user] Calling Fabric from Python |
Date: |
Sat, 18 Sep 2010 15:26:19 +0200 |
Hi,
Unfortunately, I have already read the documentation but might have missed or
didn't understood something.
Currently, my biggest issue is:
>>> from fabric.api import env, run
>>> env.user = 'root'
>>> env.hosts = ['whatever',]
>>> env.host = 'whatever'
>>> def test():
... run('uname -a')
...
>>> test()
No hosts found. Please specify (single) host string for connection:
If I put that in a fabfile.py and run a fab test it will work.
Regards,
Xavier.
Le 18 sept. 2010 à 14:58, Jeff Forcier a écrit :
> Hi Xavier,
>
> Make sure you read the documentation[1]; it does need more work
> regarding library use, but you can still get very far just by reading
> the usage docs, especially the one on execution.
>
> Best,
> Jeff
>
> [1] http://docs.fabfile.org/
>
>
> On Sat, Sep 18, 2010 at 7:20 AM, Xavier Ordoquy <address@hidden> wrote:
>> Hi,
>>
>> I have been using Fabric for some time now and I am very happy with the help
>> it provides for system administration.
>> However, I'd like to go one step furtherand couple fabric together with a
>> python script - ie calling fabric from my own scripts.
>> I'm getting a real hard time understanding how I can start tasks from my
>> python script, esp settings things such as hosts, users and so on.
>>
>> I didn't manage to find something on the net about using fabric from within
>> python.
>> Maybe someone has a link, a blog entry or whatever to help me getting
>> started ?
>>
>> Regards,
>> Xavier.
>> _______________________________________________
>> Fab-user mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/fab-user
>>
>
>
>
> --
> Jeff Forcier
> Unix sysadmin; Python/Ruby developer
> http://bitprophet.org