execute does not support file for stdin

Bug #1198985 reported by Edward Hope-Morley
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.concurrency
Triaged
Wishlist
Unassigned

Bug Description

processutils.execute() does not support PIPEing stdout of one command to stdin of another using a file. Currently, only passing var as stdin is suppored which means that all data must be held in memory. If the first process generates a large amount of data this will have an undesirable effect and this approach is discouraged in the Python docs:

http://docs.python.org/2/library/subprocess.html#popen-constructor

I would like to add an alternative method to the standard processutils.execute() that allows something like:

p1 = Popen(cmd1, stdout=subprocess.PIPE)
p2 = Popen(cmd2, stdin=p1.stdout, stdout=subprocess.PIPE)
p1.stdout.close()
out = p2.communicate()[0]

as recommended in the docs.

Changed in cinder:
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
Thierry Carrez (ttx) wrote :

That code belongs to Oslo and is synced into Cinder, so that would have to be implemented there.

affects: cinder → oslo
Changed in oslo:
status: New → In Progress
Changed in oslo:
status: In Progress → New
Changed in oslo:
importance: Undecided → Wishlist
status: New → Triaged
Julien Danjou (jdanjou)
Changed in oslo.concurrency:
status: New → Triaged
importance: Undecided → Wishlist
no longer affects: oslo-incubator
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.