diff options
author | Manuel QuiƱones <manuq@laptop.org> | 2011-11-22 11:45:21 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2011-11-23 17:57:55 (GMT) |
commit | 92cae4ae1e0859205986ea88692c2f197008f1aa (patch) | |
tree | 880b548f3706c0f0beee509f9a268ccb8ccba8d2 /logcollect.py | |
parent | 18186b5e271cf94f9c6eac58d080aa2efd76a7e8 (diff) |
Adding another path for lookup of mfg-data directory - OLPC #11116
The mfg-data directory is located in another path for some builds, so
the activity has to check in both places for existence.
Signed-off-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'logcollect.py')
-rw-r--r-- | logcollect.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/logcollect.py b/logcollect.py index a1251a4..82c1bba 100644 --- a/logcollect.py +++ b/logcollect.py @@ -51,6 +51,9 @@ import httplib import mimetypes import urlparse +MFG_DATA_PATHS = ['/ofw/mfg-data/', '/proc/device-tree/mfg-data/'] + + class MachineProperties: """Various machine properties in easy to access chunks. """ @@ -111,12 +114,17 @@ class MachineProperties: return line[8:].strip() def _mfg_data(self, item): - """Return mfg data item from /ofw/mfg-data/""" - - if not os.path.exists('/ofw/mfg-data/'+item): + """Return mfg data item from mfg-data directory""" + + mfg_path = None + for test_path in MFG_DATA_PATHS: + if os.path.exists(test_path + item): + mfg_path = test_path + item + break + if mfg_path == None: return '' - - v = self.__read_file('/ofw/mfg-data/'+item) + + v = self.__read_file(mfg_path) # Remove trailing 0 character, if any: if v != '' and ord(v[len(v)-1]) == 0: v = v[:len(v)-1] |