Skip to content

Commit

Permalink
Merge pull request #136 from dariusstefan/python-opensips
Browse files Browse the repository at this point in the history
Fix to_dict method: use config.defaults
  • Loading branch information
razvancrainea authored Nov 13, 2024
2 parents 9194ca2 + e6ea035 commit 4a0e40f
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 4a0e40f

Please sign in to comment.