Consider a Linux server that has the following line in .bash_profileyour user:
echo "Hello world"
So, every time you enter ssh, you see Hello world
Now consider the following fabric script:
from fabric.api import *
env.hosts = [...]
@task
def test():
with cd('/'):
print run('ls').split()
You expect it to output something like: ['tmp', 'etc', 'var', ...]
But the actual output will be: ['Hello', 'world', 'tmp', 'etc', 'var', ...]
Is this a bug in the fabric ? Is there any way to suppress server output?
time.sleep() Does not help
source
share