mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
New module - meraki_snmp (#39882)
* Initial commit for meraki_admin module * Initial commit for meraki_snmp module * Update code to be operational for SNMP settings - Add optional_ignore value to is_update_required for one-time fields - Write documentation - Perform checks and execute changes * Minor fixes and test improvements - Fix some documentation errors - Implement and test for idempotency * Removed meraki_admin which shouldn't be there, ansibot changes * Rename params to be lower case - Updated integration tests - Changed CamelCase to lowercase and underscore * Code cleanup changes based on comments from Dag.
This commit is contained in:
@@ -122,16 +122,18 @@ class MerakiModule(object):
|
||||
else:
|
||||
self.params['protocol'] = 'http'
|
||||
|
||||
def is_update_required(self, original, proposed):
|
||||
def is_update_required(self, original, proposed, optional_ignore=None):
|
||||
''' Compare original and proposed data to see if an update is needed '''
|
||||
is_changed = False
|
||||
ignored_keys = ('id', 'organizationId')
|
||||
if not optional_ignore:
|
||||
optional_ignore = ('')
|
||||
|
||||
# self.fail_json(msg="Update required check", original=original, proposed=proposed)
|
||||
|
||||
for k, v in original.items():
|
||||
try:
|
||||
if k not in ignored_keys:
|
||||
if k not in ignored_keys and k not in optional_ignore:
|
||||
if v != proposed[k]:
|
||||
is_changed = True
|
||||
except KeyError:
|
||||
@@ -139,7 +141,7 @@ class MerakiModule(object):
|
||||
is_changed = True
|
||||
for k, v in proposed.items():
|
||||
try:
|
||||
if k not in ignored_keys:
|
||||
if k not in ignored_keys and k not in optional_ignore:
|
||||
if v != original[k]:
|
||||
is_changed = True
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user