diff options
author | Jack Lloyd <[email protected]> | 2017-01-14 22:53:02 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-01-14 22:53:02 -0500 |
commit | 7eb382e4af1978841176326ed213a7a46e3cb2ad (patch) | |
tree | 462c0806d49621b46cd5b47662f49765fdd3cc7f /configure.py | |
parent | a287a5204872868134b8b5e7956cfad6161089f2 (diff) |
Handle processor name in /proc/cpuinfo that as a colon in the name itself
Seen on AMD Opteron A1100 running Linux 4.1
Diffstat (limited to 'configure.py')
-rwxr-xr-x | configure.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/configure.py b/configure.py index 523a4ce58..5063d24bd 100755 --- a/configure.py +++ b/configure.py @@ -34,12 +34,12 @@ import time import errno import optparse # pylint: disable=deprecated-module -import botan_version - # Avoid useless botan_version.pyc (Python 2.6 or higher) if 'dont_write_bytecode' in sys.__dict__: sys.dont_write_bytecode = True +import botan_version + class ConfigureError(Exception): pass @@ -1191,16 +1191,16 @@ def system_cpu_info(): try: with open('/proc/cpuinfo') as f: for line in f.readlines(): - if line.find(':') != -1: - (key, val) = [s.strip() for s in line.split(':')] + colon = line.find(':') + if colon > 1: + key = line[0:colon].strip() + val = ' '.join([s.strip() for s in line[colon+1:].split(' ') if s != '']) # Different Linux arch use different names for this field in cpuinfo if key in ["model name", "cpu model", "Processor"]: - val = ' '.join(val.split()) - logging.debug('Found CPU model "%s" in /proc/cpuinfo' % (val)) + logging.info('Detected CPU model "%s" in /proc/cpuinfo' % (val)) cpu_info.append(val) break - except IOError: pass |