import sys
from fabric.api import *
env.hosts = ['my.host.com']
env.user = 'myuser'
env.password = 'mypassword'
# env.shell = '/bin/bash -l -c'
def deploy():
x = run("cd /srv/proj/")
print x.__dict__
I'm trying to login into remote shell and execute this simple cd
command.
although it shows that there is no error
[my.host.com] run: cd /srv/proj/
{'succeeded': True, 'return_code': 0, 'failed': False, 'command': 'cd /srv/proj/', 'stderr': '', 'real_command': '/bin/bash -l -c "cd /srv/proj/"'}
but when I execute run('ls')
after cd command, it prints nothing but definitely there are files. so what is happening here. apart from that I'm having issues in executing manually set command (i mean alias in .bashrc file). fabric uses /bin/bash -l -c ...
. how can I overcome this hurdles.
I'm using ubuntu 14.04
ps: it's not same as os.chdir