Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-29 Thread Tomáš Golembiovský
On Thu, 28 Jul 2016 13:28:42 +0200 Tomáš Golembiovský wrote: > On Thu, 21 Jul 2016 08:24:57 -0400 (EDT) > Francesco Romani wrote: > > > - Original Message - > > > From: "Nir Soffer" > > > To: "Tomáš Golembiovský"

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-28 Thread Tomáš Golembiovský
On Thu, 21 Jul 2016 08:24:57 -0400 (EDT) Francesco Romani wrote: > - Original Message - > > From: "Nir Soffer" > > To: "Tomáš Golembiovský" > > Cc: "Francesco Romani" , "devel" , > >

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-21 Thread Francesco Romani
- Original Message - > From: "Nir Soffer" > To: "Tomáš Golembiovský" > Cc: "Francesco Romani" , "devel" , > "Yaniv Bronheim" , > "Shahar Havivi" > Sent: Thursday, July

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-21 Thread Nir Soffer
On Thu, Jul 21, 2016 at 1:51 PM, Tomáš Golembiovský wrote: > On Thu, 21 Jul 2016 03:26:44 -0400 (EDT) > Francesco Romani wrote: > >> - Original Message - >> > From: "Nir Soffer" >> > To: "Yaniv Bronheim"

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-21 Thread Tomáš Golembiovský
On Thu, 21 Jul 2016 03:26:44 -0400 (EDT) Francesco Romani wrote: > - Original Message - > > From: "Nir Soffer" > > To: "Yaniv Bronheim" > > Cc: "Shahar Havivi" , "Richard Jones" > > ,

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-21 Thread Francesco Romani
- Original Message - > From: "Nir Soffer" > To: "Yaniv Bronheim" > Cc: "Shahar Havivi" , "Richard Jones" > , "devel" > Sent: Tuesday, July 19, 2016 4:18:31 PM > Subject: Re: [ovirt-devel]

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-19 Thread Nir Soffer
On Tue, Jul 19, 2016 at 5:07 PM, Yaniv Bronheim wrote: > > On Tue, Jul 19, 2016 at 4:56 PM, Tomáš Golembiovský > wrote: >> >> On Thu, 14 Jul 2016 17:25:28 +0300 >> Nir Soffer wrote: >> >> > After https://gerrit.ovirt.org/#/c/46733/

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-19 Thread Yaniv Bronheim
On Tue, Jul 19, 2016 at 4:56 PM, Tomáš Golembiovský wrote: > On Thu, 14 Jul 2016 17:25:28 +0300 > Nir Soffer wrote: > > > After https://gerrit.ovirt.org/#/c/46733/ you should be able to create > > the pipeline in python like this: > > > > v2v =

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-19 Thread Tomáš Golembiovský
On Thu, 14 Jul 2016 17:25:28 +0300 Nir Soffer wrote: > After https://gerrit.ovirt.org/#/c/46733/ you should be able to create > the pipeline in python like this: > > v2v = Popen(["virt-v2v", ...], stdout=PIPE, stderr=STDOUT) > tee = Popen(["tee", "-a", logfile],

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Nir Soffer
On Thu, Jul 14, 2016 at 3:40 PM, Tomáš Golembiovský wrote: > On Thu, 14 Jul 2016 15:07:29 +0300 > Nir Soffer wrote: > >> On Mon, Jul 11, 2016 at 12:53 PM, Tomáš Golembiovský >> wrote: >> > On Wed, 6 Jul 2016 18:37:54 +0300 >> > Yaniv

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Richard W.M. Jones
On Thu, Jul 14, 2016 at 02:40:06PM +0200, Tomáš Golembiovský wrote: > This is something I have tried as first, as you can see here: > > https://gerrit.ovirt.org/#/c/59834/4/lib/vdsm/v2v.py@404 > > The problem with this approach is that we don't get proper exit code from > virt-v2v > because of

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Richard W.M. Jones
On Thu, Jul 14, 2016 at 03:07:29PM +0300, Nir Soffer wrote: > This should work with execCmd, since the special subprocess.STDOUT > parameter is handled in subprocess.Popen, and cpopen.CPopen inherit > this code. However this is not tested with cpopen, so it may be broken. > > But merging stdout

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Tomáš Golembiovský
On Thu, 14 Jul 2016 15:07:29 +0300 Nir Soffer wrote: > On Mon, Jul 11, 2016 at 12:53 PM, Tomáš Golembiovský > wrote: > > On Wed, 6 Jul 2016 18:37:54 +0300 > > Yaniv Bronheim wrote: > > > >> On Wed, Jul 6, 2016 at 5:07 PM, Tomáš

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Tomáš Golembiovský
On Thu, 14 Jul 2016 07:06:38 -0400 (EDT) Francesco Romani wrote: > > useful you can add those parameters to execCmd > > Good news about cpopen! > > Is it a good idea to add even more parameters to execCmd? Let's discuss this. > > another approach I could think of is

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-14 Thread Nir Soffer
On Mon, Jul 11, 2016 at 12:53 PM, Tomáš Golembiovský wrote: > On Wed, 6 Jul 2016 18:37:54 +0300 > Yaniv Bronheim wrote: > >> On Wed, Jul 6, 2016 at 5:07 PM, Tomáš Golembiovský >> wrote: >> >> > >> > Merging stdout and stderr to one

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-11 Thread Yaniv Bronheim
On Mon, Jul 11, 2016 at 12:53 PM, Tomáš Golembiovský wrote: > On Wed, 6 Jul 2016 18:37:54 +0300 > Yaniv Bronheim wrote: > > > On Wed, Jul 6, 2016 at 5:07 PM, Tomáš Golembiovský > > wrote: > > > > > > > > Merging stdout and stderr

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-06 Thread Yaniv Bronheim
On Wed, Jul 6, 2016 at 5:07 PM, Tomáš Golembiovský wrote: > On Tue, 5 Jul 2016 11:18:58 +0300 > Yaniv Bronheim wrote: > > > On Tue, Jul 5, 2016 at 10:44 AM, Yaniv Bronheim > wrote: > > > > > Hi > > > I do work to remove the cpopen

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-06 Thread Tomáš Golembiovský
On Tue, 5 Jul 2016 11:18:58 +0300 Yaniv Bronheim wrote: > On Tue, Jul 5, 2016 at 10:44 AM, Yaniv Bronheim wrote: > > > Hi > > I do work to remove the cpopen usages from execCmd. Using std popen over > > py3 and subprocess32 over py2 which both

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-05 Thread Yaniv Bronheim
On Tue, Jul 5, 2016 at 10:44 AM, Yaniv Bronheim wrote: > Hi > I do work to remove the cpopen usages from execCmd. Using std popen over > py3 and subprocess32 over py2 which both implements the same api. The only > gap is the output object for async calls that we need to

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-05 Thread Yaniv Bronheim
Hi I do work to remove the cpopen usages from execCmd. Using std popen over py3 and subprocess32 over py2 which both implements the same api. The only gap is the output object for async calls that we need to align with the standard implementation and modify our current usages. I don't think that

Re: [ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-01 Thread Francesco Romani
- Original Message - > From: "Tomáš Golembiovský" > To: devel@ovirt.org > Sent: Friday, July 1, 2016 4:43:45 PM > Subject: [ovirt-devel] execCmd() and storing stdout and stderr in log file [..] > That's why I think having it present in execCmd() ready for everyone's

[ovirt-devel] execCmd() and storing stdout and stderr in log file

2016-07-01 Thread Tomáš Golembiovský
Hi, I had a need recently to run a command with execCmd() and store it's output and error to a log file, while still receiving it in the calling code. Redirecting the error to output stream to have all in one stream is also useful feature. All this can be done in the calling code: a) On the