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)
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue