From: David Garcia Date: Tue, 4 May 2021 17:32:21 +0000 (+0200) Subject: Fix bug 1246 X-Git-Tag: release-v10.0-start~3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F10737%2F1;p=osm%2FMON.git Fix bug 1246 Remove hardcoded hostname in dashboarder.py Additionally, I commented out two lines in osm_mon/collector/vnf_collectors/juju.py because flake8 was complaining about those two not being used Change-Id: I44c7b083fe99ee910eb4adc0da7d6a01aac5b979 Signed-off-by: David Garcia --- diff --git a/osm_mon/collector/vnf_collectors/juju.py b/osm_mon/collector/vnf_collectors/juju.py index 30f4586..0e2fac2 100644 --- a/osm_mon/collector/vnf_collectors/juju.py +++ b/osm_mon/collector/vnf_collectors/juju.py @@ -40,8 +40,8 @@ class VCACollector(BaseCollector): super().__init__(config) self.common_db = CommonDbClient(config) self.loop = asyncio.get_event_loop() - host = config.get("vca", "host") - port = config.get("vca", "port") if "port" in config.conf["vca"] else 17070 + # host = config.get("vca", "host") + # port = config.get("vca", "port") if "port" in config.conf["vca"] else 17070 # Backwards compatibility if "cacert" in config.conf["vca"]: diff --git a/osm_mon/dashboarder/dashboarder.py b/osm_mon/dashboarder/dashboarder.py index 8b16988..3b454b8 100644 --- a/osm_mon/dashboarder/dashboarder.py +++ b/osm_mon/dashboarder/dashboarder.py @@ -25,6 +25,7 @@ import logging import time import socket import asyncio +from urllib.parse import urlparse from osm_mon.dashboarder.service import DashboarderService from osm_mon.core.config import Config @@ -119,9 +120,10 @@ class Dashboarder: def dashboard_forever(self): log.debug('dashboard_forever') + grafana_parsed_uri = urlparse(self.conf.get('grafana', 'url')) while True: try: - socket.gethostbyname("grafana") + socket.gethostbyname(grafana_parsed_uri.hostname) log.debug("Dashboard backend is running") except socket.error: log.debug("Dashboard backend is not available")