From ed28a2c3ec6bc6268f8a1bb8cfed0b9f764a41f6 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 8 Jan 2018 10:20:32 +0100 Subject: [PATCH] Include should occur only once in the file --- platypush/config/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/platypush/config/__init__.py b/platypush/config/__init__.py index 5a5ab4553a..dc7e3f68e8 100644 --- a/platypush/config/__init__.py +++ b/platypush/config/__init__.py @@ -74,10 +74,14 @@ class Config(object): for section in file_config: if section == 'include': - included_config = self._read_config_file(file_config[section]) + include_files = file_config[section] \ + if isinstance(file_config[section], list) \ + else [file_config[section]] - for incl_section in included_config.keys(): - config[incl_section] = included_config[incl_section] + for include_file in include_files: + included_config = self._read_config_file(include_file) + for incl_section in included_config.keys(): + config[incl_section] = included_config[incl_section] elif 'disabled' not in file_config[section] \ or file_config[section]['disabled'] is False: config[section] = file_config[section]