|
From: | Jorge Vargas |
Subject: | Re: [Fab-user] Purely local tasks |
Date: | Thu, 26 Sep 2013 01:39:36 -0400 |
On Mon, Sep 23, 2013 at 6:13 PM, Jorge Vargas <address@hidden> 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?
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('address@hidden' % 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?
Which of these to solutions is better in the end?
Thanks,
Jon
[Prev in Thread] | Current Thread | [Next in Thread] |