In order to make layer options available to charms using different base layers than
layer:basic (such as k8s charms), the handling of layer options was split into its own layer,
layer:options. This layer is already included by
layer:basic, so you don’t need to explicitly include it in your charm’s
layer.yaml; charms should continue working without modification.
However, due to the fact that
charms.layer.options is now a proper module, the interface had to change slightly. The old API for getting layer options is now deprecated and I’d like to encourage everyone to update to the new API (though a bit of a hack was used to maintain backwards compatibility and allow for the transition period).
The change required is pretty minimal. The old convention was to call
from charms import layer layer.options('section')
The new convention just adds
You can also now provide a specific option name to get that one value, rather than the entire dict of options:
layer.options.get('section', 'option') # can still do this, too, if you want layer.options.get('section')['option']
Thanks for your understanding.