Log errors for invalid interface values

This commit is contained in:
Calum Lind 2014-02-18 19:33:42 +00:00
parent 05792809b5
commit 68b893fa02
2 changed files with 7 additions and 6 deletions

View File

@ -126,9 +126,12 @@ class Core(component.Component):
# If there was an interface value from the command line, use it, but
# store the one in the config so we can restore it on shutdown
self.__old_interface = None
if listen_interface and deluge.common.is_ip(listen_interface):
self.__old_interface = self.config["listen_interface"]
self.config["listen_interface"] = listen_interface
if listen_interface:
if deluge.common.is_ip(listen_interface):
self.__old_interface = self.config["listen_interface"]
self.config["listen_interface"] = listen_interface
else:
log.error("Invalid listen interface (must be IP Address): %s", listen_interface)
def start(self):
"""Starts the core"""

View File

@ -98,9 +98,6 @@ class Daemon(object):
return 1
SetConsoleCtrlHandler(win_handler)
if listen_interface and not is_ip(listen_interface):
listen_interface = None
# Start the core as a thread and join it until it's done
self.core = Core(listen_interface=listen_interface)
@ -108,6 +105,7 @@ class Daemon(object):
port = self.core.config["daemon_port"]
if interface and not is_ip(interface):
log.error("Invalid UI interface (must be IP Address): %s", interface)
interface = None
self.rpcserver = RPCServer(