Alon Bar-Lev has posted comments on this change.

Change subject: core: Add executePipe
......................................................................


Patch Set 3:

(3 comments)

http://gerrit.ovirt.org/#/c/26213/3/src/otopi/plugin.py
File src/otopi/plugin.py:

Line 410:                 popenKwargsList,
Line 411:                 exc_info=True
Line 412:             )
Line 413:             raise
Line 414: 
> Ahh, I guess you refer to what I added above :-) (added that after posting 
yes
Line 415:         return {
Line 416:             'stdout': popens[-1].stdout,
Line 417:             'result': [
Line 418:                 {


Line 468:             temp_stdin, temp_name = tempfile.mkstemp()
Line 469:             atexit.register(os.unlink, temp_name)
Line 470:             with os.fdopen(temp_stdin, 'w') as f:
Line 471:                 f.write('\n'.join(stdin).encode('utf-8'))
Line 472:             temp_stdin = open(temp_name, 'r')
> Not sure how.
will check
Line 473: 
Line 474:         res_dict = self.executePipeRaw(
Line 475:             popenKwargsList=popenKwargsList,
Line 476:             stdin=temp_stdin if stdin is not None else None,


Line 518:         if len(RCs) > 0 and raiseOnError:
Line 519:             # Log the last one, somewhat similarly to pipefail in bash
Line 520:             raise RuntimeError(
Line 521:                 _("Command '{command}' failed to execute").format(
Line 522:                     command=popenKwargsList[RCs[-1][0]]['args'][0]
> Again - followed 'execute' - you print there only args[0]. I guess your poi
I would like to print the entire pipe command to user not just the failed 
command, as it is not important what failed.

 cmd1 | cmd2 | cmd3 failed

then you do not need failed_commands as well, and can use set in above 
condition.
Line 523:                 )
Line 524:             )
Line 525:         return res
Line 526: 


-- 
To view, visit http://gerrit.ovirt.org/26213
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I4a434fbe1308ac2f603b8ae09756354c11138912
Gerrit-PatchSet: 3
Gerrit-Project: otopi
Gerrit-Branch: master
Gerrit-Owner: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: Sandro Bonazzola <sbona...@redhat.com>
Gerrit-Reviewer: Simone Tiraboschi <stira...@redhat.com>
Gerrit-Reviewer: Yedidyah Bar David <d...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to