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

12
setup

@ -58,6 +58,7 @@ class Facts(object):
self.facts = {} self.facts = {}
self.get_platform_facts() self.get_platform_facts()
self.get_distribution_facts() self.get_distribution_facts()
self.get_cmdline()
self.get_public_ssh_host_keys() self.get_public_ssh_host_keys()
self.get_selinux_facts() self.get_selinux_facts()
@ -103,6 +104,17 @@ class Facts(object):
else: else:
self.facts['distribution'] = name 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): def get_public_ssh_host_keys(self):
dsa_filename = '/etc/ssh/ssh_host_dsa_key.pub' dsa_filename = '/etc/ssh/ssh_host_dsa_key.pub'
rsa_filename = '/etc/ssh/ssh_host_rsa_key.pub' rsa_filename = '/etc/ssh/ssh_host_rsa_key.pub'

Loading…
Cancel
Save