Abhijeet Rastogi
2018-05-15 05:14:10 UTC
Hi everyone,
I have a use-case where I can't use the Fabric command directly. I run my
tasks as:-
from fabric import ThreadingGroup as Group
from fabric.exceptions import GroupException
hosts = ['web1', 'web2', 'web3']
g = Group(*hosts)
results = g.run('date')
Now, as I don't use "hide=both" with the "g.run" function call, the stdout
of the command is printed in the terminal directly.
How do I prepend the output with the "fabric.connection.Connection" it's
associated with, in a streaming way. I know, I can collect the output with
the "results" that is returned but I want to do that in a streaming way and
not after all commands are finished executing. (just like it happened with
the older fabric.api.execute 1.0 version API)
I have a use-case where I can't use the Fabric command directly. I run my
tasks as:-
from fabric import ThreadingGroup as Group
from fabric.exceptions import GroupException
hosts = ['web1', 'web2', 'web3']
g = Group(*hosts)
results = g.run('date')
Now, as I don't use "hide=both" with the "g.run" function call, the stdout
of the command is printed in the terminal directly.
How do I prepend the output with the "fabric.connection.Connection" it's
associated with, in a streaming way. I know, I can collect the output with
the "results" that is returned but I want to do that in a streaming way and
not after all commands are finished executing. (just like it happened with
the older fabric.api.execute 1.0 version API)
--
Cheers,
Abhijeet Rastogi (shadyabhi)
Cheers,
Abhijeet Rastogi (shadyabhi)