-
Notifications
You must be signed in to change notification settings - Fork 83
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
Fix KeyError when comparing datasource without basicAuth #316
Conversation
HEllo @LiMuBei . Regarding the checls failure, you need to add a changelog fragment so the tests can pass |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #316 +/- ##
==========================================
- Coverage 71.07% 71.03% -0.04%
==========================================
Files 18 18
Lines 1853 1854 +1
Branches 318 319 +1
==========================================
Hits 1317 1317
Misses 396 396
- Partials 140 141 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Hi. I added a fragment. |
If there is no check for its presence, this will fail if a datasource is not configured with basic auth at all. In that case it would try to remove an entry from the dict that is not there resulting in a KeyError.
If there is no check for its presence, this will fail if a datasource is not configured with basic auth at all. In that case it would try to remove an entry from the dict that is not there resulting in a KeyError.
SUMMARY
When comparing the existing datasource with the should be state, basicAuth is handled incorrectly in the case when the datasource is not configured with basicAuth at all. This case would result in a KeyError which this change fixes.
ISSUE TYPE
COMPONENT NAME
grafana_datasource.py
See also #248