From 65447fa3c09d73157c1038eabe216033ac011bd8 Mon Sep 17 00:00:00 2001 From: Artem30801 Date: Mon, 6 Jan 2020 23:16:47 +0300 Subject: [PATCH] Added config response --- Drone/client.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Drone/client.py b/Drone/client.py index 53d50fa..e969c6a 100644 --- a/Drone/client.py +++ b/Drone/client.py @@ -204,16 +204,21 @@ def _command_config_write(*args, **kwargs): mode = kwargs.get("mode", "modify") # exceptions would be risen in case of incorrect config if mode == "rewrite": - active_client.config.load_from_dict(kwargs["config"], path=active_client.config_path) # with validation + active_client.config.load_from_dict(kwargs["config"], configspec=active_client.config_path) # with validation elif mode == "modify": new_config = ConfigManager() new_config.load_from_dict(kwargs["config"]) active_client.config.merge(new_config, validate=True) active_client.config.write() - active_client.load_config() logger.info("Config successfully updated from command") + active_client.load_config() +@messaging.request_callback("config") +def _response_config(*args, **kwargs): + response = {"config": active_client.config.fulldict, + "configspec": dict(active_client.config.configspec)} + return response @messaging.request_callback("id") def _response_id(*args, **kwargs):