mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Catching shlex splitting error in fact gathering get_cmdline call
Fixes #8352
This commit is contained in:
parent
80df2135e9
commit
7a5076c8b8
1 changed files with 9 additions and 6 deletions
|
@ -327,12 +327,15 @@ class Facts(object):
|
|||
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]
|
||||
try:
|
||||
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]
|
||||
except ValueError, e:
|
||||
pass
|
||||
|
||||
def get_public_ssh_host_keys(self):
|
||||
dsa_filename = '/etc/ssh/ssh_host_dsa_key.pub'
|
||||
|
|
Loading…
Reference in a new issue