Fix request_restart()

Pass a json enconded UUID in restart-nonce to the principal charm.
This commit is contained in:
Felipe Reyes 2022-07-28 10:33:04 -04:00
parent 0e7c6e0a90
commit 84895d283d

View File

@ -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."""