[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[minion-cvs] Patch for bug in serverinfo generation



Update of /home/minion/cvsroot/src/minion/lib/mixminion/server
In directory moria.mit.edu:/tmp/cvs-serv25112/lib/mixminion/server

Modified Files:
	Modules.py ServerKeys.py 
Log Message:
Patch for bug in serverinfo generation

Index: Modules.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/Modules.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Modules.py	12 Dec 2002 19:56:47 -0000	1.2
+++ Modules.py	15 Dec 2002 04:35:55 -0000	1.3
@@ -186,6 +186,8 @@
     #    queueRoot: directory where all the queues go.
     #    queues: a map from module name to queue (Queue objects must support
     #            queueMessage and sendReadyMessages as in DeliveryQueue.)
+    #    _isConfigured: flag: has this modulemanager's configure method been
+    #            called?
 
     def __init__(self):
 	"Create a new ModuleManager"
@@ -203,6 +205,12 @@
         self.registerModule(DropModule())
         self.registerModule(MixmasterSMTPModule())
 
+        self._isConfigured = 0
+
+    def isConfigured(self):
+        """Return true iff this object's configure method has been called"""
+        return self._isConfigured
+
     def _setQueueRoot(self, queueRoot):
 	"""Sets a directory under which all modules' queue directories
 	   should go."""
@@ -269,6 +277,7 @@
 	createPrivateDir(self.queueRoot)
         for m in self.modules:
             m.configure(config, self)
+        self._isConfigured = 1
 
     def enableModule(self, module):
 	"""Sets up the module manager to deliver all messages whose exitTypes

Index: ServerKeys.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/server/ServerKeys.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ServerKeys.py	12 Dec 2002 19:56:47 -0000	1.1
+++ ServerKeys.py	15 Dec 2002 04:35:55 -0000	1.2
@@ -503,6 +503,9 @@
                 continue
             info += "%s: %s" % (k, _rule(k=='Allow',v))
 
+    if not config.moduleManager.isConfigured():
+        config.moduleManager.configure(config)
+
     # Ask our modules for their configuration information.
     info += "".join(config.moduleManager.getServerInfoBlocks())