From 4448be8a9a4e0d57442ec901b22a5035df8598c0 Mon Sep 17 00:00:00 2001 From: Amber Charitos Date: Thu, 30 May 2024 10:21:01 +0100 Subject: [PATCH] add blocked status and close usersync port --- src/charm.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/charm.py b/src/charm.py index f9da258..5d7f4fa 100755 --- a/src/charm.py +++ b/src/charm.py @@ -305,13 +305,12 @@ def update(self, event): 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) else: - logger.error( - "Programmer error, please add your 'charm_function' to the logic." - ) + self.unit.status = BlockedStatus("Missing charm-function.") return logger.info("planning ranger %s execution", charm_function)