ouput from model.get_status in python-libjuju doesn't have machine-status in it, while juju status --format json does. Using it for juju-lint will fail with KeyError:
2020-01-22 07:28:59 [ERROR] OpenStack charm 'openstack-dashboard' not found
Traceback (most recent call last):
File "/usr/bin/juju-lint", line 11, in <module>
load_entry_point('juju-lint===1.0.0.dev2-201910310005-ubuntu18.04.1', 'console_scripts', 'juju-lint')()
File "/usr/lib/python3/dist-packages/jujulint.py", line 453, in main
lint(filename, lint_rules)
File "/usr/lib/python3/dist-packages/jujulint.py", line 421, in lint
check_statuses(j, applications)
File "/usr/lib/python3/dist-packages/jujulint.py", line 340, in check_statuses
check_status_pair(machine_name, "machine", juju_status["machines"][machine_name])
File "/usr/lib/python3/dist-packages/jujulint.py", line 330, in check_status_pair
check_status("%s %s" % (status_type.title(), name), data_d[primary],
KeyError: 'machine-status'
juju-lint failed with the following error: Command '['juju-lint', '--config', '/usr/share/juju-lint/contrib/canonical-openstack-rules.yaml', '--override-subordinate', '', '--loglevel', 'INFO', '--logfile', '', '/var/lib/juju-lint/juju-status.json']' returned non-zero exit status 1.
ouput from
model.get_status
inpython-libjuju
doesn't havemachine-status
in it, whilejuju status --format json
does. Using it forjuju-lint
will fail withKeyError
:Issue has been reported on python-libjuju side:
https://github.com/juju/python-libjuju/issues/387
In the meanwhile, we can also avoid such KeyError from juju-lint itself.
Imported from Launchpad using lp2gh.
date created: 2020-01-23T03:32:21Z
owner: guoqiao
assignee: None
the launchpad url