<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 11, 2016 at 12:53 PM, Tomáš Golembiovský <span dir="ltr"><<a href="mailto:tgolembi@redhat.com" target="_blank">tgolembi@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span class="">On Wed, 6 Jul 2016 18:37:54 +0300<br>
Yaniv Bronheim <<a href="mailto:ybronhei@redhat.com">ybronhei@redhat.com</a>> wrote:<br>
<br>
> On Wed, Jul 6, 2016 at 5:07 PM, Tomáš Golembiovský <<a href="mailto:tgolembi@redhat.com">tgolembi@redhat.com</a>><br>
> wrote:<br>
><br>
> ><br>
</span><span class="">> > Merging stdout and stderr to one can POpen do for us, I belive. Any<br>
> > logging can indeed be done as a wrapper around execCmd.<br>
><br>
> saving stdout and err to log while the process is running is useful only<br>
> for your purpose currently. using asyncproc as you do now in v2v allows you<br>
> to to run a process and monitor it.. can you use overriding of aysncProc<br>
> wrapper for your needs instead of changing cpopen or execcmd code?<br>
<br>
</span>I am not talking about CPOpen. I meant that when calling<br>
`subprocess.Popen`, you can pass it `stderr=subprocess.STDOUT` argument<br>
and it will handle the FD redirection (stream merging). To me it seems<br>
like a proper way of doing this.<br></blockquote><div><br></div><div><br></div><div>In vdsm we currently use cpopen to start external process - as multiprocess.popen in py2 is buggy. using execCmd doesn't provide stderr and stdout parameters to modify. but you can use CPopen directly and override stderr.</div><div>Over py3 we import the standard multiprocess.Popen. basically if its actually useful you can add those parameters to execCmd </div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
<span class=""><br>
<br>
> > > [...]<br>
> > ><br>
> > > btw, after examine the area again, isn't watchCmd func is what you<br>
> > > describe? we just need to replace the asyncProc usages there with<br>
> > > something that doesn't use StringIO as we do to support py3<br>
> ><br>
> > I'm not sure how watchCmd can help with this. Isn't it just a wrapper to<br>
> > get asynchrounous process with a stop condition?<br>
> ><br>
><br>
> it is. thought you need something similar and afterwards log the outputs<br>
<br>
</span>I can run async process with `execCmd` directly and I don't need any<br>
stop condition. Am I missing something that `watchCmd` provides?<br>
<div class=""><div class="h5"><br></div></div></blockquote><div>probably I didn't get you right at first. forget about watchcmd. I thought that you're trying to log the output and in watchcmd we do it with execCmdLogger, so I wrote that to show you a reference .</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
--<br>
Tomáš Golembiovský <<a href="mailto:tgolembi@redhat.com">tgolembi@redhat.com</a>><br>
_______________________________________________<br>
Devel mailing list<br>
<a href="mailto:Devel@ovirt.org">Devel@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman/listinfo/devel</a></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-size:12.8px"><b>Yaniv Bronhaim.</b></span><br></div></div></div></div></div>
</div></div>