fab-user
[Top][All Lists]
Advanced

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

Re: [Fab-user] lcd seems broken


From: Brandon Whaley
Subject: Re: [Fab-user] lcd seems broken
Date: Wed, 30 Sep 2015 21:32:44 +0000

lcd is intended to modify the local() call (and maybe get, put, et al?  I haven't tested).  It does not actually change the cwd afaik.

>>> from fabric.api import local, lcd
>>> print fabric.api.local('pwd', capture=True)
[localhost] local: pwd
/home/redkrieg/projects/fabric
>>> with lcd('/usr/bin'):
...     print fabric.api.local('pwd', capture=True)
... 
[localhost] local: pwd
/usr/bin


On Wed, Sep 30, 2015 at 5:18 PM Paul Hoffman <address@hidden> wrote:
...but maybe it is just me.

print(os.getcwd())
with lcd("/usr/bin"):
  print(os.getcwd())

...prints the same location name twice, and it is clear that the cd didn't happen.

print(os.getcwd())
with lcd("/does/not/exist"):
  print(os.getcwd())

...prints the same location name twice. lcd doesn't throw an error, which I would have thought it would.

Is this what is expected?

--Paul Hoffman
_______________________________________________
Fab-user mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fab-user

reply via email to

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