selfcheck.py: skip boot duration check on not Clover image

This commit is contained in:
Oleg Kalachev
2022-09-03 22:53:38 +03:00
parent 0425e1da24
commit 28d77aea33

View File

@@ -625,6 +625,10 @@ def check_rangefinder():
@check('Boot duration')
def check_boot_duration():
if not os.path.exists('/etc/clover_version'):
info('skip check')
return # Don't check not on Clover's image
output = subprocess.check_output('systemd-analyze').decode()
r = re.compile(r'([\d\.]+)s\s*$', flags=re.MULTILINE)
duration = float(r.search(output).groups()[0])