mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #44235 from xavierog/fix-grafana4-datasource-2017.7
grafana4: datasource: handle missing keys in datasource description.
This commit is contained in:
commit
a97f1c87e0
@ -151,6 +151,12 @@ def present(name,
|
||||
ret['changes'] = data
|
||||
return ret
|
||||
|
||||
# At this stage, the datasource exists; however, the object provided by
|
||||
# Grafana may lack some null keys compared to our "data" dict:
|
||||
for key in data:
|
||||
if key not in datasource:
|
||||
datasource[key] = None
|
||||
|
||||
if data == datasource:
|
||||
ret['changes'] = None
|
||||
ret['comment'] = 'Data source {0} already up-to-date'.format(name)
|
||||
|
Loading…
Reference in New Issue
Block a user