Skip to content

Commit

Permalink
handle possibility of no options field in dashboard panel
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-vince committed Dec 28, 2023
1 parent 9855c63 commit 4cdcebc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions grafana_dashboard_manager/commands/dashboard_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def update_panel_dashlist_folder_ids(panel: dict, folder_info: dict[str, Folder]
logger.debug(f"Panel {folder_name} was not found in folders")
return panel

# Some dashboard panels may not contain an `options` field
if not panel.get("options"):
logger.warning(f"Panel {folder_name} does not have an options field to modify")
return panel

# Look up the target folder using the panel title - it needs to match!
logger.info(f"Updating Panel {folder_name} with {folder.uid=} and {folder.id=}")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "grafana_dashboard_manager"
version = "0.2.5"
version = "0.2.6"
description = "A cli utility that uses Grafana's HTTP API to easily save and restore dashboards."
authors = ["Vince Chan <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 4cdcebc

Please sign in to comment.