Skip to content

Commit

Permalink
FIX idempotency of grafana_dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Cassiano Leal committed Mar 2, 2017
1 parent 0fda621 commit b2d4408
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/grafana_dashboard/grafana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def slug
end

def content
@dashboard
@dashboard.reject {|k,v| k =~ /^id|version|title$/}
end

def content=(value)
Expand Down
3 changes: 2 additions & 1 deletion lib/puppet/type/grafana_dashboard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
end

munge do |value|
JSON.parse(value)
new_value = JSON.parse(value).reject {|k,v| k =~ /^id|version|title$/}
new_value.sort.to_h
end

def should_to_s(value)
Expand Down

0 comments on commit b2d4408

Please sign in to comment.