fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] Calling Fabric from Python


From: Jeff Forcier
Subject: Re: [Fab-user] Calling Fabric from Python
Date: Sat, 18 Sep 2010 09:41:50 -0400

Try this:

    http://docs.fabfile.org/0.9.2/usage/execution.html#connections

-Jeff

On Sat, Sep 18, 2010 at 9:26 AM, Xavier Ordoquy <address@hidden> wrote:
> 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
>
>
> _______________________________________________
> Fab-user mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/fab-user
>



-- 
Jeff Forcier
Unix sysadmin; Python/Ruby developer
http://bitprophet.org



reply via email to

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