forked from canonical/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactor main.py to add a new _Manager class (canonical#1085)
Contributes to ops some of the abstractions developed for Scenario. This is not a functional change, that is, ops functions in exactly the same way. Improvements: * tidier, more object-oriented. `main.py` was hard to understand and extend - (therefore) easier to play with in e.g. testing frameworks or experimental modules wishing to modify or extend its functionality - easier to maintain The core contributions are: - a `_Manager` class encapsulating the management of the ops lifecycle, from instantiation of Framework and charm instances to storage creation, event emission, and storage commit. - adding the `CharmMeta.from_charm_root` method to load a `CharmMeta` instance from the relevant `*.yaml` files --------- Co-authored-by: Ben Hoyt <[email protected]> Co-authored-by: Tony Meyer <[email protected]> Co-authored-by: Tony Meyer <[email protected]> Co-authored-by: Ben Hoyt <[email protected]>
- Loading branch information
1 parent
9ebc3f9
commit 4d846b2
Showing
5 changed files
with
226 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.