* fixes: value from config was not taken

This commit is contained in:
age 2007-02-08 07:44:06 +00:00
parent 1bce8e6b4d
commit fd00cf0d83

View file

@ -35,8 +35,7 @@ import cryptobox.plugins.base
## specify (in seconds), how long we should wait before redirecting and ip change ## specify (in seconds), how long we should wait before redirecting and ip change
REDIRECT_DELAY = 10 REDIRECT_DELAY = 10
CHANGE_IP_DELAY = 5 CHANGE_IP_DELAY = 5
## default network interface (may be overriden by the "interface" setting of the ## default network interface (if none is given via cryptobox.conf)
## network plugin in cryptobox.conf
DEFAULT_INTERFACE = "eth0" DEFAULT_INTERFACE = "eth0"
class network(cryptobox.plugins.base.CryptoBoxPlugin): class network(cryptobox.plugins.base.CryptoBoxPlugin):
@ -331,9 +330,13 @@ class network(cryptobox.plugins.base.CryptoBoxPlugin):
def __get_interface(self): def __get_interface(self):
"""Return the name of the configured network interface """Return the name of the configured network interface
""" """
if "interface" in self.defaults: #self.cbox.log.debug("network plugin default config:")
return self.defaults["interface"] #self.cbox.log.debug(self.defaults)
if "interface" in self.defaults["network"]:
self.cbox.log.error(DEFAULT_INTERFACE)
return self.defaults["network"]["interface"]
else: else:
self.cbox.log.error(DEFAULT_INTERFACE)
return DEFAULT_INTERFACE return DEFAULT_INTERFACE