From 6777a9ab6a37f5d1b6f575d8e6f786781a6fcb27 Mon Sep 17 00:00:00 2001 From: Borjan Tchakaloff Date: Wed, 17 Feb 2021 18:05:08 +0100 Subject: [PATCH] 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. --- library/storage/syncthing/syncthing_folder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/storage/syncthing/syncthing_folder.py b/library/storage/syncthing/syncthing_folder.py index 7b13579..ad842d3 100644 --- a/library/storage/syncthing/syncthing_folder.py +++ b/library/storage/syncthing/syncthing_folder.py @@ -280,7 +280,9 @@ def run_module(): break else: 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) if folder_config is None: