execute does not support file for stdin

Bug #1198985 reported by Edward Hope-Morley on 2013-07-08
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo.concurrency
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)
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) on 2014-12-04
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  Edit
Everyone can see this information.

Other bug subscribers