Skip to content

Commit

Permalink
Fail loudly if GRAFANA_TOKEN isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Apr 13, 2024
1 parent 0345d7f commit f362d26
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import json
import os
import re
import shutil
import ssl
import subprocess
from copy import deepcopy
Expand Down Expand Up @@ -203,7 +204,12 @@ def main():

args = parser.parse_args()

grafana_token = os.environ['GRAFANA_TOKEN']
# ensure GRAFANA_TOKEN
grafana_token = os.environ.get("GRAFANA_TOKEN")
if not grafana_token:
raise ValueError(
"The environment variable GRAFANA_TOKEN needs to be set in order to deploying dashboards to a Grafana deployment."
)

api = partial(
grafana_request,
Expand Down

0 comments on commit f362d26

Please sign in to comment.