[node-patches] Change in ovirt-node[master]: Workaround missing subprocess.check_output on Python 2.6

rbarry at redhat.com rbarry at redhat.com
Mon Jun 24 20:30:44 UTC 2013


Ryan Barry has uploaded a new change for review.

Change subject: Workaround missing subprocess.check_output on Python 2.6
......................................................................

Workaround missing subprocess.check_output on Python 2.6

EL6 and derivatives can't use subprocess.check_output, since it
was not added until Python 2.7. Silently redirect them to the
existing ovirt.node.utils.process.pipe() function if they're on
Python 2.6

Change-Id: Ia201854707fd1300766488d8094585b90b868b3c
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/process.py
1 file changed, 3 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/49/16049/1

diff --git a/src/ovirt/node/utils/process.py b/src/ovirt/node/utils/process.py
index be0cebc..9345beb 100644
--- a/src/ovirt/node/utils/process.py
+++ b/src/ovirt/node/utils/process.py
@@ -73,6 +73,9 @@
     """
     kwargs = __update_kwargs(kwargs)
     LOGGER.debug("Checking output with: %s %s" % (args, kwargs))
+    if sys.version_info[:2] == (2, 6):
+        #No subprocess.check_output
+        return pipe(*args)
     return unicode(subprocess.check_output(*args, **kwargs),
                    encoding=sys.stdin.encoding)
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia201854707fd1300766488d8094585b90b868b3c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list