From e6ea03501ecec7617dc4fcff25309e75ab9ead13 Mon Sep 17 00:00:00 2001 From: Darius Stefan Date: Wed, 13 Nov 2024 11:59:57 +0200 Subject: [PATCH] Fix to_dict method: use config.defaults --- opensipscli/config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opensipscli/config.py b/opensipscli/config.py index 3ac5f8a..73e5329 100644 --- a/opensipscli/config.py +++ b/opensipscli/config.py @@ -143,10 +143,12 @@ def read_param(self, param, prompt, default=None, yes_no=False, return val def to_dict(self): + temp = defaults.DEFAULT_VALUES.copy() + temp = temp | self.config.defaults() + if not self.config.has_section(self.current_instance): - return defaults.DEFAULT_VALUES | self.custom_options | self.dynamic_options - - temp = {} + return temp | self.custom_options | self.dynamic_options + for option in self.config.options(self.current_instance): temp[option] = self.config.get(self.current_instance, option)