[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[minion-cvs] Configure recommended server versions in config file; d...



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

Modified Files:
	Directory.py ServerList.py 
Log Message:
Configure recommended server versions in config file; don't hardwire
them in the source code.


Index: Directory.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/directory/Directory.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- Directory.py	3 Jan 2004 07:35:24 -0000	1.17
+++ Directory.py	27 Jul 2004 03:13:02 -0000	1.18
@@ -127,7 +127,9 @@
         """Return the ServerList for this directory"""
         if not self.serverList:
             from mixminion.directory.ServerList import ServerList
-            self.serverList = ServerList(self.directoryBase, self.getIDCache())
+            self.serverList = ServerList(self.directoryBase,
+                                         self.config,
+                                         self.getIDCache())
         return self.serverList
 
     def getInbox(self):
@@ -166,6 +168,8 @@
            "BadServer" : ("ALLOW*", None, None),
            "BadServerFile" : ("ALLOW*", "filename", None),
            "ExcludeServer" : ("ALLOW*", None, None),
+           "ClientVersions" : ("REQUIRE", "list", None),
+           "ServerVersions" : ("REQUIRE", "list", None),
         },
         'Publishing' : {
            "__SECTION__": ('REQUIRE', None, None),

Index: ServerList.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/directory/ServerList.py,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- ServerList.py	11 May 2004 16:28:15 -0000	1.55
+++ ServerList.py	27 Jul 2004 03:13:02 -0000	1.56
@@ -35,17 +35,6 @@
 from mixminion.ServerInfo import ServerDirectory, ServerInfo, \
      _getDirectoryDigestImpl
 
-ACCEPTABLE_CLIENT_VERSIONS = "0.0.6.2 0.0.7rc2 0.0.7 0.0.7.1"
-ACCEPTABLE_SERVER_VERSIONS = "0.0.6.1 0.0.6.2 0.0.7rc2 0.0.7 0.0.7.1"
-
-# Make sure that the VERSIONS variables above are parseable.
-for vl in (ACCEPTABLE_CLIENT_VERSIONS.split(),
-           ACCEPTABLE_SERVER_VERSIONS.split()):
-    for v in vl:
-        mixminion.parse_version_string(v)
-del v
-del vl
-
 class ServerList:
     """A ServerList holds a set of server descriptors for use in generating
        directories.  It checks new descriptors for consistency with old ones
@@ -90,11 +79,12 @@
     #     identity
     #     .lock
 
-    def __init__(self, baseDir, idCache=None):
+    def __init__(self, baseDir, config, idCache=None):
         """Initialize a ServerList to store servers under baseDir/servers,
            creating directories as needed.
         """
         self.baseDir = baseDir
+        self.config = config
         if idCache is None:
             idCache = mixminion.directory.Directory.IDCache(
                 os.path.join(baseDir, "xx_idcache"))
@@ -317,6 +307,9 @@
             goodServers.sort()
             goodServers = ", ".join(goodServers)
 
+            clientVersions = self.config['Directory']['ClientVersions']
+            serverVersions = self.config['Directory']['ServerVersions']
+
             #FFFF Support for multiple signatures
             header = """\
             [Directory]
@@ -337,8 +330,8 @@
                    formatDate(endAt),
                    goodServers,
                    formatBase64(pk_encode_public_key(identityKey)),
-                   ACCEPTABLE_CLIENT_VERSIONS,
-                   ACCEPTABLE_SERVER_VERSIONS)
+                   ", ".join(clientVersions),
+                   ", ".join(serverVersions))
 
             directory = header+"".join(contents)
             directory = _getDirectoryDigestImpl(directory, identityKey)