diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-09-14 16:14:29 -0500 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-09-14 16:14:29 -0500 |
commit | 4a4d300678715a5f990ea43fcdff39cfa5d14df6 (patch) | |
tree | bc8dcf18db25fe6a460cf54fd79c3b098f0cb3c6 | |
parent | 249a81646c01c0dde1eec5a5b776a382813d4614 (diff) | |
download | cxmanage-4a4d300678715a5f990ea43fcdff39cfa5d14df6.tar.gz |
Use subprocess.Popen() instead of subprocess.check_output()v0.5.0
-rw-r--r-- | cxmanage/image.py | 5 | ||||
-rwxr-xr-x | scripts/cxmanage | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/cxmanage/image.py b/cxmanage/image.py index 7819be0..dcaca2d 100644 --- a/cxmanage/image.py +++ b/cxmanage/image.py @@ -109,8 +109,9 @@ class Image: def verify(self): """ Return true if the image is valid, false otherwise """ try: - file_type = subprocess.check_output(["file", self.filename] - ).split()[1] + file_process = subprocess.Popen(["file", self.filename], + stdout=subprocess.PIPE) + file_type = file_process.communicate()[0].split()[1] if self.type == "SOC_ELF": if file_type != "ELF": return False diff --git a/scripts/cxmanage b/scripts/cxmanage index b9fecf4..e6d6287 100755 --- a/scripts/cxmanage +++ b/scripts/cxmanage @@ -303,7 +303,8 @@ def check_versions(): args = [os.environ['IPMITOOL_PATH'], '-V'] else: args = ['ipmitool', '-V'] - ipmitool_version = subprocess.check_output(args).split()[2] + ipmitool_process = subprocess.Popen(args, stdout=subprocess.PIPE) + ipmitool_version = ipmitool_process.communicate()[0].split()[2] if not '-cx' in ipmitool_version: print 'ERROR: cxmanage is not compatible with IPMItool version %s\n'\ % ipmitool_version |