From 4393ac2d66aa41b8bd88aa9dd4256860cb740ac4 Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Fri, 22 Sep 2023 10:15:31 +1200 Subject: [PATCH] Update docstring to align with the new open/close port ones. --- 1 | 0 ops/model.py | 14 +++++--------- 2 files changed, 5 insertions(+), 9 deletions(-) create mode 100644 1 diff --git a/1 b/1 new file mode 100644 index 000000000..e69de29bb diff --git a/ops/model.py b/ops/model.py index 3fff905f6..6b665c96f 100644 --- a/ops/model.py +++ b/ops/model.py @@ -665,15 +665,11 @@ def opened_ports(self) -> Set['Port']: def set_ports(self, *ports: Union[int, 'Port']) -> None: """Set the open ports for this unit, closing any others that are open. - Register intent with Juju that the application should be accessed on - the given ports and no others, but the ports are not actually opened - externally until the admin runs "juju expose" and any closed ports are - not actually closed externally until the admin runs "juju unexpose". - - On Kubernetes sidecar charms, the ports opened are not strictly - per-unit: Juju will open the union of ports from all units. - However, normally charms should make the same set_ports() call from - every unit. + Some behaviour, such as whether the port is opened or closed externally without + using Juju's ``expose`` & ``unexpose`` commands, differs between Kubernetes + and machine charms. See the + `Juju documentation `__ + for more detail. Use :meth:`open_port` and :meth:`close_port` to manage ports individually.