diff options
author | George Kraft <george.kraft@calxeda.com> | 2012-11-29 14:35:09 -0600 |
---|---|---|
committer | George Kraft <george.kraft@calxeda.com> | 2012-11-29 14:35:09 -0600 |
commit | 5a02a590a41f0a19f5be78734948d6d98dade707 (patch) | |
tree | 390f76cc99d8f93136d6c0fc2642390fcf25f644 | |
parent | b12257eee64ee75be227c2055947900986cd3f06 (diff) | |
download | cxmanage-5a02a590a41f0a19f5be78734948d6d98dade707.tar.gz |
CXMAN-156, CXMAN-157: Skip 'file' check for most image types
Fedora and Ubuntu are seeing different results from the 'file'
command, so we can't rely on it for the various data images. Still
works with SOC_ELF images though.
-rw-r--r-- | cxmanage_api/image.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/cxmanage_api/image.py b/cxmanage_api/image.py index ce11f02..bce4450 100644 --- a/cxmanage_api/image.py +++ b/cxmanage_api/image.py @@ -156,20 +156,18 @@ class Image: :rtype: boolean """ - try: - file_process = subprocess.Popen(["file", self.filename], - stdout=subprocess.PIPE) - file_type = file_process.communicate()[0].split()[1] + if (self.type == "SOC_ELF"): + try: + 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 - elif (file_type != "data"): - return False - except OSError: - # "file" tool wasn't found, just continue without it - # typically located: /usr/bin/file - pass + except OSError: + # "file" tool wasn't found, just continue without it + # typically located: /usr/bin/file + pass if (self.type in ["CDB", "BOOT_LOG"]): # Look for "CDBH" |