Merge pull request #1005 from dagwieers/cmdline

Add /proc/cmdline information to the default facts
reviewable/pr18780/r1
Michael DeHaan 12 years ago
commit a3b67ec039

14
setup

@ -58,6 +58,7 @@ class Facts(object):
self.facts = {}
self.get_platform_facts()
self.get_distribution_facts()
self.get_cmdline()
self.get_public_ssh_host_keys()
self.get_selinux_facts()
@ -103,6 +104,17 @@ class Facts(object):
else:
self.facts['distribution'] = name
def get_cmdline(self):
data = get_file_content('/proc/cmdline')
if data:
self.facts['cmdline'] = {}
for piece in shlex.split(data):
item = piece.split('=', 1)
if len(item) == 1:
self.facts['cmdline'][item[0]] = True
else:
self.facts['cmdline'][item[0]] = item[1]
def get_public_ssh_host_keys(self):
dsa_filename = '/etc/ssh/ssh_host_dsa_key.pub'
rsa_filename = '/etc/ssh/ssh_host_rsa_key.pub'
@ -204,7 +216,7 @@ class LinuxHardware(Hardware):
MEMORY_FACTS = ['MemTotal', 'SwapTotal', 'MemFree', 'SwapFree']
# DMI bits
DMI_DICT = dict(
form_factor = '/sys/devices/virtual/dmi/id/chassis_type',
form_factor = '/sys/devices/virtual/dmi/id/chassis_type',
product_name = '/sys/devices/virtual/dmi/id/product_name',
product_serial = '/sys/devices/virtual/dmi/id/product_serial',
product_uuid = '/sys/devices/virtual/dmi/id/product_uuid',

Loading…
Cancel
Save