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 <david.garcia@canonical.com>
(cherry picked from commit
5269fc31c6ed52819996f85f15e740a97b5ad688)
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
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")