test - get devices
This commit is contained in:
parent
0c93969c8e
commit
aa914a89d4
|
@ -81,6 +81,9 @@ response:
|
|||
|
||||
from ansible_collections.community.syncthing.plugins.module_utils.syncthing_api import SyncthingModule
|
||||
|
||||
def deep_equal(a, b):
|
||||
return json.dumps(a, sort_keys=True) == json.dumps(b, sort_keys=True)
|
||||
|
||||
# Returns an object of a new folder
|
||||
def create_folder(params, self_id, existing_device_ids):
|
||||
wanted_device_ids = {self_id}
|
||||
|
@ -221,7 +224,8 @@ def run_module():
|
|||
folder_with_updated_data = update_folder(
|
||||
folder, module.params, self_id, existing_device_ids
|
||||
)
|
||||
module.patch_call(data=folder_with_updated_data, target=folder['id'])
|
||||
if not deep_equal(folder, folder_with_updated_data):
|
||||
module.patch_call(data=folder_with_updated_data, target=folder['id'])
|
||||
else: # Doesn't exist but needs to be added
|
||||
if module.check_mode:
|
||||
module.result['changed'] = True
|
||||
|
|
Loading…
Reference in New Issue