Skip to content

Commit

Permalink
Fix to_dict method: use config.defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusstefan committed Nov 13, 2024
1 parent 9194ca2 commit e6ea035
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions opensipscli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e6ea035

Please sign in to comment.