<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 6, 2016 at 5:07 PM, Tomáš Golembiovský <span dir="ltr">&lt;<a href="mailto:tgolembi@redhat.com" target="_blank">tgolembi@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 5 Jul 2016 11:18:58 +0300<br>
Yaniv Bronheim &lt;<a href="mailto:ybronhei@redhat.com">ybronhei@redhat.com</a>&gt; wrote:<br>
<br>
&gt; On Tue, Jul 5, 2016 at 10:44 AM, Yaniv Bronheim &lt;<a href="mailto:ybronhei@redhat.com">ybronhei@redhat.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; Hi<br>
&gt; &gt; I do work to remove the cpopen usages from execCmd. Using std popen over<br>
&gt; &gt; py3 and subprocess32 over py2 which both implements the same api. The only<br>
&gt; &gt; gap is the output object for async calls that we need to align with the<br>
&gt; &gt; standard implementation and modify our current usages. I don&#39;t think that<br>
&gt; &gt; adding more non-standard logics to execCmd is a good idea. we should fit<br>
&gt; &gt; the standard usage in this function or override it separately with specific<br>
&gt; &gt; implementation in commands.py. You may propose such patch<br>
<br>
</span>Sure, that makes sense. Are there any existing drafts/patches I could<br>
look at or help with?<br></blockquote><div>no.. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Merging stdout and stderr to one can POpen do for us, I belive. Any</blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
logging can indeed be done as a wrapper around execCmd.<br>
<br></blockquote><div>saving stdout and err to log while the process is running is useful only for your purpose currently. using asyncproc as you do now in v2v allows you to to run a process and monitor it.. can you use overriding of aysncProc wrapper for your needs instead of changing cpopen or execcmd code?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
&gt; [...]<br>
<span class="">&gt;<br>
&gt; btw, after examine the area again, isn&#39;t watchCmd func is what you<br>
&gt;  describe? we just need to replace the asyncProc usages there with<br>
&gt; something that doesn&#39;t use StringIO as we do to support py3<br>
<br>
</span>I&#39;m not sure how watchCmd can help with this. Isn&#39;t it just a wrapper to<br>
get asynchrounous process with a stop condition?<br></blockquote><div> </div><div>it is. thought you need something similar and afterwards log the outputs  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Could you elaborate on why we want to get rid of StringIO in AsyncProc?<br></blockquote><div>it uses StringIO.read and it is not supported in py3. we need to change the implementation to support six.StringIO</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
If I understand it right, it&#39;s purpose is to make sure the executed<br>
program doesn&#39;t stall on full pipe if VDSM isn&#39;t fast enough in<br>
processing the output. Or am I missing something? But it could again be<br>
implemented as a wrapper around execCmd and not in it. Is that what you<br>
mean?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Tomáš Golembiovský &lt;<a href="mailto:tgolembi@redhat.com">tgolembi@redhat.com</a>&gt;<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>