From 84895d283d5b6562c77fa537bc33678ce12dfb34 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Thu, 28 Jul 2022 10:33:04 -0400 Subject: [PATCH] Fix request_restart() Pass a json enconded UUID in restart-nonce to the principal charm. --- src/charm.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/charm.py b/src/charm.py index 921d337..8612309 100755 --- a/src/charm.py +++ b/src/charm.py @@ -242,11 +242,13 @@ class KeystoneOpenIDCCharm(ops_openstack.core.OSBaseCharm): logger.info(f'Disabling apache2 module: {self.APACHE2_MODULE}') subprocess.check_call(['a2dismod', self.APACHE2_MODULE]) - def request_restart(self): + def request_restart(self, service_name=None): """Request a restart of the service to the principal.""" relation = self.model.get_relation('keystone-fid-service-provider') data = relation.data[self.unit] - data['restart-nonce'] + + logger.debug('Requesting a restart to the principal charm') + data['restart-nonce'] = json.dumps(str(uuid4())) def render_config(self): """Render Service Provider configuration files to be used by Apache."""