Merge pull request #3175 from jpmens/setup9

Protect None value in setup module (ansible 1.2)
This commit is contained in:
Michael DeHaan 2013-06-13 04:22:15 -07:00
commit 3c6d5f95f8

View file

@ -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)