From b388042cd63f4844cffb02da430c3143d3542c26 Mon Sep 17 00:00:00 2001 From: thouveng Date: Mon, 12 Dec 2016 16:53:38 +0100 Subject: [PATCH] Fix issue when new keys are available in datasource (#21) 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..c5fb7ff 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 versions of Grafana can introduce new keys that are not present + # in _get_json_data. + elif key in new and old[key] == new[key]: del old[key] del new[key] return {'old': old, 'new': new}