Skip to content

Commit

Permalink
fix: grafana api key variable ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed May 31, 2024
1 parent d3ac6e2 commit 7dd1f7c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/lookup/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ def grafana_switch_organisation(self, headers):

def grafana_headers(self):
headers = {"content-type": "application/json; charset=utf8"}
if module.params.get("grafana_api_key", None):
self.headers["Authorization"] = (
"Bearer %s" % module.params["grafana_api_key"]
)
if self.grafana_api_key.get("grafana_api_key", None):
headers["Authorization"] = "Bearer %s" % self.grafana_api_key
else:
headers["Authorization"] = basic_auth_header(
self.grafana_user, self.grafana_password
Expand Down

0 comments on commit 7dd1f7c

Please sign in to comment.