From cc4378a7b1182e3c01fa94fd84af8097fa4be2b2 Mon Sep 17 00:00:00 2001 From: David Garcia Date: Fri, 17 Dec 2021 08:30:59 +0100 Subject: [PATCH] Fix bug 1833: fix DATA_SOURCE_NAME in mysqld-exporter Change-Id: I6641aa68aaa920bbe14ca688b984c5591c0ff72d Signed-off-by: David Garcia --- installers/charm/mysqld-exporter/src/charm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installers/charm/mysqld-exporter/src/charm.py b/installers/charm/mysqld-exporter/src/charm.py index 91be02a6..46588b9a 100755 --- a/installers/charm/mysqld-exporter/src/charm.py +++ b/installers/charm/mysqld-exporter/src/charm.py @@ -185,9 +185,9 @@ class MysqlExporterCharm(CharmedOsmBase): self._check_missing_dependencies(config) data_source = ( - config.mysql_uri.replace("mysql://", "").split("/")[0] + f'{config.mysql_uri.replace("mysql://", "").replace("@", "@(").split("/")[0]})/' if config.mysql_uri - else f"root:{self.mysql_client.root_password}@{self.mysql_client.host}:{self.mysql_client.port}" + else f"root:{self.mysql_client.root_password}@({self.mysql_client.host}:{self.mysql_client.port})/" ) # Create Builder for the PodSpec -- 2.25.1