On Mon, Sep 23, 2013 at 11:00 PM, Jon Dufresne <jon.dufre...@gmail.com>wrote:

> On Mon, Sep 23, 2013 at 6:13 PM, Jorge Vargas <jorge.var...@gmail.com>wrote:
>
>> Sadly no, if you search the archives they are many attempts to do this
>> and in the end the best option is to just use local() all over the place,
>> which removes some of the advanced functions of fabric like the puts() you
>> mention.
>>
>
> As in local('echo ...'), or should I simply use Python's print at this
> point?
>

print is what I do.

>
>
>> Or configure your machine/environment in a way that fabric can ssh to the
>> same machine you are runnings things from foolling it into thinking it's a
>> remote machine.
>>
>
> Something like this?
>
> def local_task(f):
>     user = getpass.getuser()
>     wrapper = hosts('%s@localhost' % user)
>     return wrapper(task(f))
>
> @local_task
> def my_task():
>    ...
>
> Is this reliable across multiple environments? Will this require the
> running machine to also be running an SSH server?
>

yes and yes.

right or you could just set @hosts('localhost')


> Which of these to solutions is better in the end?
>

Again it depends on how much of fabric you use. if your task uses anything
other than local() you are probably best using the SSH into your own
machine.


>
> Thanks,
> Jon
>
>
_______________________________________________
Fab-user mailing list
Fab-user@nongnu.org
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to