Skip to content

Commit

Permalink
fixes InfluxDB TLS Support #7
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-Ricardo committed Aug 3, 2020
1 parent 77549b6 commit 0793a69
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions fritzinfluxdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ def check_db_status(db_handler, db_name):
"""
Check if InfluxDB handler has access to a database.
If it doesn't exist try to create it.
If anything fails exit program
Parameters
----------
Expand All @@ -247,13 +246,11 @@ def check_db_status(db_handler, db_name):
Name of DB to check
"""

dblist = None

try:
dblist = db_handler.get_list_database()
except Exception as e:
logging.error('Problem connecting to database: %s', str(e))
exit(1)
return

if db_name not in [db['name'] for db in dblist]:

Expand All @@ -263,7 +260,7 @@ def check_db_status(db_handler, db_name):
db_handler.create_database(db_name)
except Exception as e:
logging.error('Problem creating database: %s', str(e))
exit(1)
return
else:
logging.debug(f'Influx Database <{db_name}> exists')

Expand Down Expand Up @@ -327,8 +324,8 @@ def main():
config.get('influxdb', 'username'),
config.get('influxdb', 'password'),
config.get('influxdb', 'database'),
config.get('influxdb', 'ssl', fallback=False),
config.get('influxdb', 'verify_ssl', fallback=False)
config.getboolean('influxdb', 'ssl', fallback=False),
config.getboolean('influxdb', 'verify_ssl', fallback=False)
)
# test more config options and see if they are present
_ = config.get('influxdb', 'measurement_name')
Expand Down

0 comments on commit 0793a69

Please sign in to comment.