Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions lib/charms/operator_libs_linux/v0/passwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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]:
Expand Down
17 changes: 15 additions & 2 deletions lib/charms/operator_libs_linux/v0/sysctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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")
Expand Down
17 changes: 15 additions & 2 deletions lib/charms/operator_libs_linux/v1/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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):
Expand Down
Loading