diff --git a/README.md b/README.md index e0897b81..3522e47c 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,17 @@ ![Release Libraries](https://github.com/canonical/operator-libs-linux/actions/workflows/release-libs.yaml/badge.svg) ![Release to Charmhub](https://github.com/canonical/operator-libs-linux/actions/workflows/release.yaml/badge.svg) +> [!WARNING] +> The libraries provided by this charm are deprecated and will no longer receive feature updates or bugfixes. +> +> Some of the libraries have been migrated to packages in the `charmlibs` monorepo: +> +> - [apt](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/apt/) +> - [passwd](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/passwd/) +> - [snap](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/snap/) +> - [sysctl](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/sysctl/) +> - [systemd](https://documentation.ubuntu.com/charmlibs/reference/charmlibs/systemd/) + ## Description The `operator-libs-linux` charm provides a set of [charm libraries] which can be used for managing and manipulating Debian packages, [snap packages], system repositories, users and groups, and other operations diff --git a/lib/charms/operator_libs_linux/v0/passwd.py b/lib/charms/operator_libs_linux/v0/passwd.py index 7eb83b28..a1153a86 100644 --- a/lib/charms/operator_libs_linux/v0/passwd.py +++ b/lib/charms/operator_libs_linux/v0/passwd.py @@ -12,7 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Simple library for managing Linux users and groups. +"""Legacy Charmhub-hosted passwd library, deprecated in favour of ``charmlibs.passwd``. + +WARNING: This library is deprecated and will no longer receive feature updates or bugfixes. +``charmlibs.passwd`` version 1.0 is a bug-for-bug compatible migration of this library. +Add 'charmlibs-passwd~=1.0' to your charm's dependencies, and remove this Charmhub-hosted library. +Then replace `from charms.operator_libs_linux.v0 import passwd` with +`from charmlibs import passwd`. +Read more: +- https://documentation.ubuntu.com/charmlibs +- https://pypi.org/project/charmlibs-passwd + +--- + +Simple library for managing Linux users and groups. The `passwd` module provides convenience methods and abstractions around users and groups on a Linux system, in order to make adding and managing users and groups easy. @@ -45,7 +58,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 def user_exists(user: Union[str, int]) -> Optional[pwd.struct_passwd]: diff --git a/lib/charms/operator_libs_linux/v0/sysctl.py b/lib/charms/operator_libs_linux/v0/sysctl.py index 34cb97be..45dbf8a0 100644 --- a/lib/charms/operator_libs_linux/v0/sysctl.py +++ b/lib/charms/operator_libs_linux/v0/sysctl.py @@ -12,7 +12,20 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Handler for the sysctl config. +"""Legacy Charmhub-hosted sysctl library, deprecated in favour of ``charmlibs.sysctl``. + +WARNING: This library is deprecated and will no longer receive feature updates or bugfixes. +``charmlibs.sysctl`` version 1.0 is a bug-for-bug compatible migration of this library. +Add 'charmlibs-sysctl~=1.0' to your charm's dependencies, and remove this Charmhub-hosted library. +Then replace `from charms.operator_libs_linux.v0 import sysctl` with +`from charmlibs import sysctl`. +Read more: +- https://documentation.ubuntu.com/charmlibs +- https://pypi.org/project/charmlibs-sysctl + +--- + +Handler for the sysctl config. This library allows your charm to create and configure sysctl options to the machine. @@ -84,7 +97,7 @@ def _on_remove(self, _): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 CHARM_FILENAME_PREFIX = "90-juju-" SYSCTL_DIRECTORY = Path("/etc/sysctl.d") diff --git a/lib/charms/operator_libs_linux/v1/systemd.py b/lib/charms/operator_libs_linux/v1/systemd.py index cdcbad6a..ea9e6f58 100644 --- a/lib/charms/operator_libs_linux/v1/systemd.py +++ b/lib/charms/operator_libs_linux/v1/systemd.py @@ -13,7 +13,20 @@ # limitations under the License. -"""Abstractions for stopping, starting and managing system services via systemd. +"""Legacy Charmhub-hosted systemd library, deprecated in favour of ``charmlibs.systemd``. + +WARNING: This library is deprecated and will no longer receive feature updates or bugfixes. +``charmlibs.systemd`` version 1.0 is a bug-for-bug compatible migration of this library. +Add 'charmlibs-systemd~=1.0' to your charm's dependencies, and remove this Charmhub-hosted library. +Then replace `from charms.operator_libs_linux.v0 import systemd` with +`from charmlibs import systemd`. +Read more: +- https://documentation.ubuntu.com/charmlibs +- https://pypi.org/project/charmlibs-systemd + +--- + +Abstractions for stopping, starting and managing system services via systemd. This library assumes that your charm is running on a platform that uses systemd. E.g., Centos 7 or later, Ubuntu Xenial (16.04) or later. @@ -64,7 +77,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 class SystemdError(Exception):