Extend hardware manager with data needed for inspector

* Added NetworkInterface.ip4_address
* Added HardwareManager.get_bmc_address()
* Added Memory.physical_mb

  This is total memory as reported by dmidecode, and yes,
  it's different from total, as it includes kernel reserved space.

* Added CPU.architecture

  As a side effect, get_cpus was switched to lscpu.
  Also fixes problem when get_cpus reported the current frequency
  instead of maximum one.

Change-Id: I4080d4d551eb0bb995a94ef9a300351910c09fb9
This commit is contained in:
Dmitry Tantsur
2015-08-06 13:03:27 +02:00
parent 70a6c37a26
commit 17c7e05235
5 changed files with 213 additions and 106 deletions

@ -64,6 +64,14 @@ def execute(*cmd, **kwargs):
return result
def try_execute(*cmd, **kwargs):
"""The same as execute but returns None on error."""
try:
return execute(*cmd, **kwargs)
except (processutils.ProcessExecutionError, OSError) as e:
LOG.debug('Command failed: %s', e)
def _read_params_from_file(filepath):
"""Extract key=value pairs from a file.