Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
try:
self.conf = cfg.CONF
self.influxdb_client = client.InfluxDBClient(
self.conf.influxdb.ip_address, self.conf.influxdb.port,
self.conf.influxdb.user, self.conf.influxdb.password,
self.conf.influxdb.database_name)
self._version = None
self._init_version()
except Exception as ex:
LOG.exception(ex)
raise exceptions.RepositoryException(ex)
self._serie_builders_version_map = {
'to_0.11.0': (self._build_serie_dimension_values_to_v0_11_0,
self._build_serie_metric_list_to_v0_11_0),
'from_0.11.0': (self._build_serie_dimension_values_from_v0_11_0,
self._build_serie_metric_list_from_v0_11_0)}
def configure(self):
self.db = influxdb.InfluxDBClient(
self.host, self.port, self.username, self.password, self.database)
try:
self.db.create_database(self.database)
# TODO: (IMPRV) handle specific exception
except:
pass
return self.db