fab-user
[Top][All Lists]
Advanced

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

[Fab-user] cd context manager and put when the remote_path is None


From: Greg Hunt
Subject: [Fab-user] cd context manager and put when the remote_path is None
Date: Mon, 6 Aug 2012 11:39:34 -0400

I've noticed that put does not adhere to the cd context manager when the remote_path is None. Is this expected behavior?

For example:

with fabric.api.settings(**settings):
    with fabric.api.cd('/mnt/worker'):
        fabric.api.run('pwd')
        fabric.api.put('test.ini')
        fabric.api.put('test.ini', '.')
        fabric.api.put('test.ini', 'foo')

yields the output:

$ python test.py
[localhost] run: pwd
[localhost] out: /mnt/worker

[localhost] put: test.ini -> /home/pdxtest/test.ini
[localhost] put: test.ini -> /mnt/worker/./test.ini
[localhost] put: test.ini -> /mnt/worker/foo


My expectation is that the first call to put should have copied the file to /mnt/worker and not to the home directory. The other two put calls behaved as I expected.

I assume that get will have the same behavior, but I have not tested it yet.

Thanks,
Greg Hunt



reply via email to

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