mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Protect None value in setup module
This commit is contained in:
parent
1fd863cf5d
commit
3f301fd439
1 changed files with 4 additions and 3 deletions
|
@ -619,6 +619,7 @@ class LinuxHardware(Hardware):
|
||||||
d['rotational'] = get_file_content(sysdir + "/queue/rotational")
|
d['rotational'] = get_file_content(sysdir + "/queue/rotational")
|
||||||
d['scheduler_mode'] = ""
|
d['scheduler_mode'] = ""
|
||||||
scheduler = get_file_content(sysdir + "/queue/scheduler")
|
scheduler = get_file_content(sysdir + "/queue/scheduler")
|
||||||
|
if scheduler is not None:
|
||||||
m = re.match(".*?(\[(.*)\])", scheduler)
|
m = re.match(".*?(\[(.*)\])", scheduler)
|
||||||
if m:
|
if m:
|
||||||
d['scheduler_mode'] = m.group(2)
|
d['scheduler_mode'] = m.group(2)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue