tests: import munet 0.13.2

fixed ConfigOptionsProxy bug

Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
Christian Hopps 2023-04-24 09:47:23 -04:00
parent ea4163ce49
commit 7d12017bd8

View File

@ -191,17 +191,18 @@ class ConfigOptionsProxy:
else: else:
self.option = ConfigOptionsProxy.DefNoneObject() self.option = ConfigOptionsProxy.DefNoneObject()
def getoption(self, opt, defval=None): def getoption(self, opt, default=None):
if not self.config: if not self.config:
return defval return default
try: try:
return self.config.getoption(opt, default=defval) value = self.config.getoption(opt)
return value if value is not None else default
except ValueError: except ValueError:
return defval return default
def get_option(self, opt, defval=None): def get_option(self, opt, default=None):
return self.getoption(opt, defval) return self.getoption(opt, default)
def get_option_list(self, opt): def get_option_list(self, opt):
value = self.get_option(opt, "") value = self.get_option(opt, "")