From df290695fc5218d4962e57803577b3d5e2ea8734 Mon Sep 17 00:00:00 2001 From: Amber Charitos Date: Thu, 30 May 2024 10:30:57 +0100 Subject: [PATCH] close port by default --- src/charm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/charm.py b/src/charm.py index 5d7f4fa..678a0a6 100755 --- a/src/charm.py +++ b/src/charm.py @@ -303,9 +303,10 @@ def update(self, event): charm_function = self.config["charm-function"].value logger.info("configuring ranger %s", charm_function) + self.model.unit.close_port(port=APPLICATION_PORT, protocol="tcp") + if charm_function == "usersync": command, context = self._configure_ranger_usersync(container) - self.model.unit.close_port(port=APPLICATION_PORT, protocol="tcp") elif charm_function == "admin": self.model.unit.open_port(port=APPLICATION_PORT, protocol="tcp") command, context = self._configure_ranger_admin(container)