Commit 335cac9a authored by Chris McDonough's avatar Chris McDonough

Don't start a monitor server if there is no emergency user.

parent 7f3cb450
......@@ -137,9 +137,16 @@ class MonitorServerFactory(ServerFactory):
ServerFactory.__init__(self, section.address)
def create(self):
password = self.getPassword()
if password is None:
msg = ('Monitor server not started because no emergency user '
'exists.')
import zLOG
zLOG.LOG("Zope", zLOG.ERROR, msg)
return
from ZServer.medusa.monitor import secure_monitor_server
return secure_monitor_server(hostname=self.host, port=self.port,
password=self.getPassword())
password=password)
def getPassword(self):
# XXX This is really out of place; there should be a better
......@@ -151,10 +158,6 @@ class MonitorServerFactory(ServerFactory):
pw = None
else:
pw = emergency_user._getPassword()
if pw is None:
import zLOG
zLOG.LOG("Zope", zLOG.WARNING, 'Monitor server not started'
' because no emergency user exists.')
return pw
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment