clustershell
clustershell copied to clipboard
Tree: handle channel stderr stream
For now in Channel
(an EventHandler
), we are using a XMLGenerator
over the channel worker object (which acts as a file object). The worker is either WorkerSsh
for the parent (the chan is PropagationChannel
) or StreamWorker
for the gateway (the chan is GatewayChannel
).
That's fine with WorkerSsh
as only 1 writer stream is used from parent to gateway. However, with StreamWorker
, we could support both stdout and stderr writers, but doing so leads to broadcasting messages to both writers (as XMLGenerator calls write() with sname=None).
We could either locally (in Communication.py) wrap the worker with an object that will explicitly write using sname=SNAME_WRITER, or provides a special accessor for worker in order to get a file-like object on a specific stream. That would probably require to port ExecWorker over StreamWorker to use StreamClient directly.