Fix bug when filling subprocess pipe 38/7838/2
authorWilliam Douglas <william.douglas@intel.com>
Wed, 7 Aug 2013 22:36:55 +0000 (15:36 -0700)
committerWilliam Douglas <william.douglas@intel.com>
Thu, 8 Aug 2013 16:41:17 +0000 (09:41 -0700)
If attempting to wait for a subprocess to complete when that
subprocess has filled a pipe and still has data to send swup will get
stuck in a wait while the subprocess is stuck in write (since swup
doesn't read from the buffer until after the wait finishes, the write
can never complete).

Since manual wait is unneeded as subprocess.communicate() will call
wait itself, just remove the extra wait call.

Change-Id: I85dec452cb09b280d2d935ae21f654c25e06a25d
Signed-off-by: William Douglas <william.douglas@intel.com>
swup.py

diff --git a/swup.py b/swup.py
index cf270b1..a291d9a 100755 (executable)
--- a/swup.py
+++ b/swup.py
@@ -250,7 +250,6 @@ def install_update(update_data):
     sub.Popen(args).wait()
     args = shlex.split("zypper -n  --reposd-dir %s patch --with-interactive  --repo %s " % (repodir, update_id))
     p = sub.Popen(args, stderr=sub.PIPE, stdout=sub.PIPE)
-    r = p.wait()
     (pout, perr) = p.communicate()
     print(pout)
     print(perr)