I’m setting up fabric for the first time, and having trouble piping the output from fabric to less. For example, if I run:
fabric deploy |less
(Where deploy is my deployment function)
I get the following error back from fabric:
IOError: [Errno 22] Invalid argument
This comes from a run() command on the remote host.
If I add pty=False to the run() arguments, it works. However, that means every run command, I need to add this argument. Not to mention, I believe it has implications with prompts and entering data (obviously for those cases I won’t be piping to less).
How can I fix this? Should I just do tty=false for everything?
Just for future reference, I resolved this by applying a patch to operations.py, as seen here:
http://code.fabfile.org/attachments/56/operations.patch
Otherwise, the code that would reproduce this problem is as follows:
And the issue would come up if you did the following command:
Hope this helps someone… I still don’t understand why a bug this old still hasn’t been patched in the latest release of fabric.
-Dustin