mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 01:07:01 +00:00
Merge pull request #392 from carlroth/master
Suppress dmidecode warnings for KVM systems
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
import pprint
|
||||
import json
|
||||
import os
|
||||
import os, sys
|
||||
import re
|
||||
import yaml
|
||||
import onl.YamlUtils
|
||||
@@ -386,6 +386,9 @@ class OnlPlatformBase(object):
|
||||
rv[field['name']] = v['data'][field['key']]
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
if 'dmidecodemod' in sys.modules:
|
||||
sys.modules['dmidecodemod'].clear_warnings()
|
||||
return rv
|
||||
|
||||
def upgrade_manifest(self, type_, override_dir=None):
|
||||
|
||||
@@ -67,6 +67,13 @@ def baseconfig():
|
||||
f.write(dmidecode.QuerySection('system')['0x0001']['data']['Version'])
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
if 'dmidecodemod' in sys.modules:
|
||||
mod = sys.modules['dmidecodemod']
|
||||
buf = mod.get_warnings()
|
||||
if buf:
|
||||
[msg("*** %s\n" % x) for x in buf.splitlines(False)]
|
||||
mod.clear_warnings()
|
||||
|
||||
if not platform.baseconfig():
|
||||
msg("*** platform class baseconfig failed.\n", fatal=True)
|
||||
|
||||
Reference in New Issue
Block a user