Merge pull request #392 from carlroth/master

Suppress dmidecode warnings for KVM systems
This commit is contained in:
Jeffrey Townsend
2018-05-29 13:12:52 -07:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@@ -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):

View File

@@ -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)