Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow InfluxV1 connection test to be skipped #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ INFLUXV1_USER
INFLUXV1_PASSWORD
INFLUXV1_VERIFY_SSL
INFLUXV1_SSL
INFLUXV1_SKIP_TEST
```

#### Influx v2
Expand Down
1 change: 1 addition & 0 deletions speedmon/storage/influxv1/influxv1_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ class InfluxV1Config(StorageConfig):
password = ''
verify_ssl = False
ssl = False
skip_test = False
9 changes: 5 additions & 4 deletions speedmon/storage/influxv1/influxv1_storage_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ def _get_storage_client(self):
)

def validate_connection(self):
if self.storage_config.skip_test:
self.active = True
return

try:
log.debug('Testing connection to InfluxDb using provided credentials')
self.client.get_list_users() # TODO - Find better way to test connection and permissions
Expand All @@ -45,11 +49,8 @@ def validate_connection(self):
elif hasattr(e, 'code') and e.code == 401:
log.error('Unable to connect to InfluxDB with provided credentials')
else:
log.error('Failed to connect to InfluxDB for unknown reason')
log.error('Failed to connect to InfluxDB for unknown reason: %s', str(e))
self.active = False
return

self.active = True

def save_results(self, data: SpeedTestResult):

Expand Down