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
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
4d853c974c
commit
275249481f
1 changed files with 5 additions and 17 deletions
|
@ -12,30 +12,18 @@ except Exception as e:
|
||||||
exit(3)
|
exit(3)
|
||||||
|
|
||||||
updates = set()
|
updates = set()
|
||||||
errors = set()
|
|
||||||
|
|
||||||
for identifier, info in json['information'].items():
|
for identifier, info in json['information'].items():
|
||||||
if info['updateAvailable']:
|
if info['updateAvailable']:
|
||||||
updates.add(info['displayName'])
|
updates.add('{} ({} → {})'.format(
|
||||||
|
info['displayName']
|
||||||
if not json['environment']['supported']:
|
info['information']['local']['value'],
|
||||||
errors.add('OctoPrint runs in an unsupported environment!')
|
info['information']['remote']['value'],
|
||||||
|
))
|
||||||
if not json['storage']['sufficient']:
|
|
||||||
errors.add('OctoPrint reports insufficient storage!')
|
|
||||||
|
|
||||||
|
|
||||||
for error in sorted(errors):
|
|
||||||
print(error)
|
|
||||||
|
|
||||||
if len(updates) > 0:
|
if len(updates) > 0:
|
||||||
print('Updates available: {}'.format(', '.join(sorted(updates))))
|
print('Updates available: {}'.format(', '.join(sorted(updates))))
|
||||||
|
|
||||||
|
|
||||||
if len(errors) > 0:
|
|
||||||
exit(2)
|
exit(2)
|
||||||
elif len(updates) > 0:
|
|
||||||
exit(1)
|
|
||||||
else:
|
else:
|
||||||
print('OK')
|
print('OK')
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
Loading…
Reference in a new issue