ops
, the Operator Framework, provides a simple, lightweight, and powerful way of
writing Juju charms, the best way to encapsulate operational experience in code.
The framework will help you to:
- model the integration of your services
- manage the lifecycle of your application
- create reusable and scalable components
- keep your code simple and readable
You can read more about the project, including how to get involved, on github.
Release highlights:
-
We added quite a few docstrings, and a test that will fail if something
is missing docstrings. -
We’re more tolerant of missing fields in the output of
network-get
,
which can happen in some situations.
Thanks to @cory_fu for this one. -
Charm authors can run
self.config
from a charm method instead of having
to doself.model.config
.
Thanks to @cory_fu for this one. -
Some ways of installing
ops
can result in not loading thelibyaml
extensions from PyYAML, giving a performance penalty.ops
will warn
when this happens so it can be remedied, but it would also warn when
running the test suite which raises the barrier for developers wanting to
contribute toops
itself. So now we ignore that.
Thanks to @cory_fu for this one. -
The
hooks_disabled
context manager can now be nested.
Thanks to @stub for this one. -
When using Juju for storage (either automatically by running on
kubernetes with a new enough Juju, or manually via passing
use_juju_for_storage=True
to main), events defered would never be
re-emitted. This is #438, found with help from @davigar15. -
ObjectEvents now have a
__repr__
which lists all events it knows about,
which can be helpful when debugging (or even developing) a complex charm. -
sys.breakpointhook
is only set frommain
, not from
Framework.__init__
, meaning it won’t interfere with using the
breakpoint()
builtin from tests. -
tests will now fail if a docstring is missing (or malformed).