Skip to content

Commit

Permalink
fix(pep8): fix sanity error
Browse files Browse the repository at this point in the history
git st
  • Loading branch information
rrey-aviatrix authored and rrey committed Aug 19, 2022
1 parent a901fce commit c5d5b39
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/modules/grafana_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,25 +267,25 @@ def grafana_dashboard_search(module, grafana_url, folder_id, title, headers):
def grafana_dashboard_changed(payload, dashboard):
# you don't need to set the version, but '0' is incremented to '1' by Grafana's API
if 'version' in payload['dashboard']:
del(payload['dashboard']['version'])
del payload['dashboard']['version']
if 'version' in dashboard['dashboard']:
del(dashboard['dashboard']['version'])
del dashboard['dashboard']['version']

# remove meta key if exists for compare
if 'meta' in dashboard:
del(dashboard['meta'])
del dashboard['meta']
if 'meta' in payload:
del(payload['meta'])
del payload['meta']

# if folderId is not provided in dashboard, set default folderId
if 'folderId' not in dashboard:
dashboard['folderId'] = 0

# Ignore dashboard ids since real identifier is uuid
if 'id' in dashboard['dashboard']:
del(dashboard['dashboard']['id'])
del dashboard['dashboard']['id']
if 'id' in payload['dashboard']:
del(payload['dashboard']['id'])
del payload['dashboard']['id']

if payload == dashboard:
return False
Expand Down

0 comments on commit c5d5b39

Please sign in to comment.