clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

Tree: handle channel stderr stream

Open thiell opened this issue 9 years ago • 0 comments

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.

thiell avatar Oct 29 '15 04:10 thiell