1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Change idempotency check to be single pass (#42087)

- Previously all data between both data structures was compared
- Results in situations where updates are done when not needed
- Changes to single pass so only data in payload is compared
This commit is contained in:
Kevin Breit 2018-07-02 21:20:36 -05:00 committed by Dag Wieers
parent 09fec5a482
commit 3ee3fc893d

View file

@ -130,14 +130,14 @@ class MerakiModule(object):
if not optional_ignore: if not optional_ignore:
optional_ignore = ('') optional_ignore = ('')
for k, v in original.items(): # for k, v in original.items():
try: # try:
if k not in ignored_keys and k not in optional_ignore: # if k not in ignored_keys and k not in optional_ignore:
if v != proposed[k]: # if v != proposed[k]:
is_changed = True # is_changed = True
except KeyError: # except KeyError:
if v != '': # if v != '':
is_changed = True # is_changed = True
for k, v in proposed.items(): for k, v in proposed.items():
try: try:
if k not in ignored_keys and k not in optional_ignore: if k not in ignored_keys and k not in optional_ignore: