syncthing_folder: Default to empty device list
When defining a new shared folder, the configuration is missing and thus there are no current devices configured.
This commit is contained in:
parent
1b2952c1a6
commit
6777a9ab6a
|
@ -280,7 +280,9 @@ def run_module():
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
folder_config = get_folder_config(module.params['id'], config)
|
folder_config = get_folder_config(module.params['id'], config)
|
||||||
folder_config_devices = [d['deviceID'] for d in folder_config['devices']]
|
folder_config_devices = (
|
||||||
|
[d['deviceID'] for d in folder_config['devices']] if folder_config else []
|
||||||
|
)
|
||||||
folder_config_wanted = create_folder(module.params, folder_config_devices)
|
folder_config_wanted = create_folder(module.params, folder_config_devices)
|
||||||
|
|
||||||
if folder_config is None:
|
if folder_config is None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user