selfcheck: Update systemd-analyze regex

This commit is contained in:
Alexey Rogachevskiy
2019-10-12 04:09:32 +03:00
parent e3fc40f2b7
commit b5ff8388b2

View File

@@ -597,7 +597,7 @@ def check_rangefinder():
@check('Boot duration')
def check_boot_duration():
output = subprocess.check_output('systemd-analyze')
r = re.compile(r'([\d\.]+)s$')
r = re.compile(r'([\d\.]+)s\s*$', flags=re.MULTILINE)
duration = float(r.search(output).groups()[0])
if duration > 15:
failure('long Raspbian boot duration: %ss (systemd-analyze for analyzing)', duration)