Skip to content

Commit ac86da2

Browse files
committed
Respect the credential keyword argument on auth when using Python API
1 parent 042eed4 commit ac86da2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# History
44

55
## Unreleased
6+
- Improved Python API authentication when using URL-based connectivity,
7+
by respecting the `credential` keyword argument
68

79
## 0.4.0 (2024-10-16)
810
- Fixed folder argument issue

grafana_import/grafana.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, **kwargs):
6767
# Configure Grafana connectivity.
6868
if "url" in kwargs:
6969
self.grafana_api = GrafanaApi.GrafanaApi.from_url(
70-
url=kwargs["url"], credential=os.environ.get("GRAFANA_TOKEN")
70+
url=kwargs["url"], credential=kwargs.get("credential", os.environ.get("GRAFANA_TOKEN"))
7171
)
7272
else:
7373
config = {}

0 commit comments

Comments
 (0)