Skip to content

Commit 75f843e

Browse files
author
Alan Zhang
committed
Check if "isFolder" exists before validation
1 parent afcd1f3 commit 75f843e

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/amg/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,7 @@ Release History
122122
2.5.3
123123
++++++
124124
* `az grafana service-account token create`: set token default expiration time to 1 day as stated in the documentation
125+
126+
2.5.4
127+
++++++
128+
* `az grafana dashboard import`: fix issue with JSON file validation

src/amg/azext_amg/custom.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def import_dashboard(cmd, grafana_name, definition, folder=None, resource_group_
386386
import copy
387387
data = _try_load_dashboard_definition(cmd, resource_group_name, grafana_name, definition,
388388
api_key_or_token=api_key_or_token)
389-
if data["meta"]["isFolder"]:
389+
if data.get("meta", {}).get("isFolder", False):
390390
raise ArgumentUsageError("The provided definition is a folder, not a dashboard")
391391

392392
if "dashboard" in data:

src/amg/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# TODO: Confirm this is the right version number you want and it matches your
1818
# HISTORY.rst entry.
19-
VERSION = '2.5.3'
19+
VERSION = '2.5.4'
2020

2121
# The full list of classifiers is available at
2222
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)