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

Fix KeyError when comparing datasource without basicAuth #316

Merged
merged 3 commits into from
Nov 5, 2023
Merged
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
2 changes: 2 additions & 0 deletions changelogs/fragments/fix-316.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- Fix error with datasources configured without basicAuth
3 changes: 2 additions & 1 deletion plugins/modules/grafana_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,8 @@
if 'readOnly' in current:
del current['readOnly']
if current['basicAuth'] is False:
del current['basicAuthUser']
if 'basicAuthUser' in current:
del current['basicAuthUser']

Check warning on line 523 in plugins/modules/grafana_datasource.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/grafana_datasource.py#L523

Added line #L523 was not covered by tests
if 'password' in current:
del current['password']
if 'basicAuthPassword' in current:
Expand Down
Loading