Python-libjuju 2.8.5 changes how relative charm paths in bundles are handled to match the Juju CLI

As a side-effect of fixing support for using local .charm files in bundles in libjuju, the base for relative charm paths in local bundles was changed to match Juju CLI behavior, which is that they are considered relative to the directory containing the bundle YAML file. Previously, libjuju was treating them as relative to whatever the current directory was, which would lead to inconsistent results, both between libjuju and the Juju CLI, as well as potentially between runs of libjuju itself.

If you were using relative paths in a bundle previously and start seeing an error like the following, you may need to update the path in the bundle:

juju.errors.JujuError: ['charm path in application "foo" does not exist: resources/charms/foo']

Thank you for the change. IIRC, juju itself had originally been doing it relative to CWD, but it made bundles brittle, because you don’t know where a user is running “juju deploy $PATHTO/bundle”. (In practice they only really worked with ‘juju deploy .’ since then CWD is the bundle base.)

1 Like