Skip to content

Commit

Permalink
Merge pull request #26 from mdvickst/master
Browse files Browse the repository at this point in the history
Modified pack-scan report columns, added support for older RHEL dmidecode
  • Loading branch information
cnsnyder authored Sep 13, 2016
2 parents 0844369 + cd1f0ea commit a030dd4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/rho/clicommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,12 @@ def _do_command(self):
'redhat-packages.last_built',
'virt-what.type', 'virt.virt',
'virt.num_guests', 'virt.num_running_guests',
'cpu.count', 'cpu.socket_count', 'ip', 'port']),
'cpu.count', 'cpu.socket_count', 'ip', 'port',
'auth.name', 'auth.type', 'auth.username', 'error',
'dmi.system-manufacturer', 'etc-release.etc-release',
'instnum.instnum', 'redhat-release.version',
'subman.virt.host_type', 'systemid.system_id',
'subman.virt.is_guest', 'uname.hardware_platform']),
]
new_config = config.Config(auths=auths, profiles=profiles, reports=reports)
print (_("Creating new config with defaults: %s") % self.options.config)
Expand Down
10 changes: 7 additions & 3 deletions src/rho/rho_cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class CpuRhoCmd(RhoCmd):
'cpu.model_ver': _("cpu model version")}

def __init__(self):
self.cmd_strings = ["cat /proc/cpuinfo", "dmidecode -t 4"]
self.cmd_strings = ["cat /proc/cpuinfo", "dmidecode | grep -A1000 'DMI type 4' | sed -n '1,/DMI type [0-3 5-9]/ p'"]
RhoCmd.__init__(self)

def parse_data(self):
Expand Down Expand Up @@ -365,7 +365,7 @@ class DmiRhoCmd(RhoCmd):
def __init__(self):
self.cmd_strings = ["dmidecode -s bios-vendor",
"dmidecode -s bios-version",
"dmidecode -s system-manufacturer",
"dmidecode | grep -A4 'System Information' | grep 'Manufacturer' | sed -n -e 's/^.*Manufacturer:\s//p'",
"dmidecode -s processor-family"]
RhoCmd.__init__(self)

Expand Down Expand Up @@ -413,7 +413,7 @@ class VirtRhoCmd(CpuRhoCmd):
def __init__(self):
CpuRhoCmd.__init__(self)
cmd_template = "if [ -e %s ] ; then echo \"true\"; else echo \"false\"; fi"
self.cmd_strings.extend(["dmidecode -s system-manufacturer",
self.cmd_strings.extend(["dmidecode | grep -A4 'System Information' | grep 'Manufacturer' | sed -n -e 's/^.*Manufacturer:\s//p'",
"ps aux | grep xend | grep -v grep",
cmd_template % "/proc/xen/privcmd",
cmd_template % "/dev/kvm",
Expand Down Expand Up @@ -494,6 +494,10 @@ def _check_dmidecode(self):
self.data["virt.type"] = "virtualpc"
self.data["virt.virt"] = "virt-guest"

if manuf.find("QEMU") > -1:
self.data["virt.type"] = "kvm"
self.data["virt.virt"] = "virt-guest"

def _check_for_xend(self):
# It would be way cooler if we could poke the cpuid and see if
# is a xen guest, but that requires a util to do it, and root
Expand Down

0 comments on commit a030dd4

Please sign in to comment.