bundles/octoprint: display version in update check, remove error states (we're monitoring this separately)
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-12-23 10:43:13 +01:00
parent 4d853c974c
commit 275249481f
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -12,30 +12,18 @@ except Exception as e:
exit(3)
updates = set()
errors = set()
for identifier, info in json['information'].items():
if info['updateAvailable']:
updates.add(info['displayName'])
if not json['environment']['supported']:
errors.add('OctoPrint runs in an unsupported environment!')
if not json['storage']['sufficient']:
errors.add('OctoPrint reports insufficient storage!')
for error in sorted(errors):
print(error)
updates.add('{} ({} → {})'.format(
info['displayName']
info['information']['local']['value'],
info['information']['remote']['value'],
))
if len(updates) > 0:
print('Updates available: {}'.format(', '.join(sorted(updates))))
if len(errors) > 0:
exit(2)
elif len(updates) > 0:
exit(1)
else:
print('OK')
exit(0)