-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enable juju-systemd-notices to observe snap services (#128)
* fix: `ruff` -> `ruff check` Original `ruff $@` is no longer supported by latest versions of ruff Signed-off-by: Jason C. Nucciarone <[email protected]> * fix!: add support for observing snap services Adds the `watch.yaml` file for configuring how the notices daemon observes services. The daemon will get the service alias from this file and use the alias to determine the proper hook to fire when the observed service is started or stopped. BREAKING CHANGES: __init__ for SystemdNotices now takes the Service data class instead of a generic list. The Service dataclass was added so that it would be easier to specify an alias for an observed service. Signed-off-by: Jason C. Nucciarone <[email protected]> * tests: update unit tests to reflect new notices API Signed-off-by: Jason C. Nucciarone <[email protected]> * tests: update integration tests * Consolidates metadata.yaml and actions.yaml into charmcraft.yaml for test charm. Less files to worry about. Signed-off-by: Jason C. Nucciarone <[email protected]> * docs: update lib documentation Signed-off-by: Jason C. Nucciarone <[email protected]> * chore(fmt): apply formatting rules Signed-off-by: Jason C. Nucciarone <[email protected]> * chore(lint): update copyright year Signed-off-by: Jason C. Nucciarone <[email protected]> * refactor: `open` -> `write_text` `yaml.dump()` returns a string if steam is none, so it is easier to just pass the content off to `write_text` instead of opening the file with a context manager. Signed-off-by: Jason C. Nucciarone <[email protected]> * fix(tests): correctly patch filesystem on python 3.8 Signed-off-by: Jason C. Nucciarone <[email protected]> * reactor: remove watch.yaml mechanism - Switch to passing the service names and aliases via argparse rather than using the pyyaml external dependency to create the watch.yaml file. - Use global map to track the observed service rather than caching the output of a watch.yaml read. Signed-off-by: Jason C. Nucciarone <[email protected]> * tests: update tests to not use watch.yaml - Reverted SystemdNotices in test charm back to the original constructor API. Signed-off-by: Jason C. Nucciarone <[email protected]> * fix(tests): remove pyfakefs as test dependency - Fixes unit tests failing on Python 3.10 due to incorrect patching. Signed-off-by: Jason C. Nucciarone <[email protected]> * refactor: remove explicit global references Signed-off-by: Jason C. Nucciarone <[email protected]> * docs: update example to use correct constructor arguments Signed-off-by: Jason C. Nucciarone <[email protected]> * chore: bump libpatch version Signed-off-by: Jason C. Nucciarone <[email protected]> --------- Signed-off-by: Jason C. Nucciarone <[email protected]>
- Loading branch information
1 parent
74ddb08
commit 9c7f617
Showing
7 changed files
with
152 additions
and
105 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
5 changes: 0 additions & 5 deletions
5
tests/integration/juju_systemd_notices/notices-charm/actions.yaml
This file was deleted.
Oops, something went wrong.
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
8 changes: 0 additions & 8 deletions
8
tests/integration/juju_systemd_notices/notices-charm/metadata.yaml
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
tests/integration/juju_systemd_notices/notices-charm/src/charm.py
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.