From 22b4d9dfe541150da383d1908365ecf26be86a2d Mon Sep 17 00:00:00 2001 From: Guillaume Thouvenin Date: Thu, 8 Dec 2016 16:57:04 +0100 Subject: [PATCH] Fix issue when new keys are available in datasource --- _states/grafana3_datasource.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_states/grafana3_datasource.py b/_states/grafana3_datasource.py index 3ac5338..254b174 100644 --- a/_states/grafana3_datasource.py +++ b/_states/grafana3_datasource.py @@ -254,7 +254,9 @@ def _diff(old, new): for key in old_keys: if key == 'id' or key == 'orgId': del old[key] - elif old[key] == new[key]: + # New version of Grafana can introduce new keys that are not present + # in _get_json_data. So we use get for new. + elif old[key] == new.get(key): del old[key] del new[key] return {'old': old, 'new': new}