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

[minion-cvs] Make pychecker a little happier, and fix some bugs in t...



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

Modified Files:
	ClientAPI.py ClientMain.py ServerInfo.py 
Log Message:
Make pychecker a little happier, and fix some bugs in the process.

Index: ClientAPI.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientAPI.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ClientAPI.py	2 Dec 2004 06:49:03 -0000	1.3
+++ ClientAPI.py	7 Dec 2004 01:44:30 -0000	1.4
@@ -531,7 +531,7 @@
     def getMessageID(self):
         pass
 
-class ReceivedSingleton(ReceivedPacket, ReceivedMessage):
+class ReceivedSingleton(ReceivedPacket):
     """The (decrypted) contents of a single packet containing an entire
        message.
     """

Index: ClientMain.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientMain.py,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- ClientMain.py	2 Jul 2004 17:08:20 -0000	1.182
+++ ClientMain.py	7 Dec 2004 01:44:30 -0000	1.183
@@ -1673,7 +1673,6 @@
     parser.init()
     directory = parser.directory
     config = parser.config
-    timeout = int(config['DirectoryServers']['DirectoryTimeout'])
     clientLock()
     try:
         directory.update(force=1)

Index: ServerInfo.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ServerInfo.py,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- ServerInfo.py	24 Aug 2004 22:16:08 -0000	1.86
+++ ServerInfo.py	7 Dec 2004 01:44:30 -0000	1.87
@@ -597,7 +597,7 @@
         contents = _cleanForDigest(contents)
 
         digest = _getMultisignedDirectoryDigest(contents)
-        sigs, info, servers = splitMultisignedDirectory(contents)
+        sigs, info, servers = _splitMultisignedDirectory(contents)
         del contents
 
         self.signatures = [ ]
@@ -620,7 +620,7 @@
         self.servers = [ ]
         for s in servers:
             si = ServerInfo(string=s, validatedDigests=validatedDigests,
-                            _keepServerContents=_keepServerContents)
+                            _keepContents=_keepServerContents)
         self.goodServerNames = [ name.lower()
              for name in self.dirInfo['Directory-Info']['Recommended-Servers'] ]
 
@@ -774,11 +774,11 @@
                         raise ConfigError("Unrecognized descriptor version: %s"
                                           % v.strip())
 
-    def validate(self):
+    def validate(self, lines, contents):
         sec = self['Directory-Info']
         if sec['Status'] not in ("consensus", "vote"):
             raise ConfigError("Unrecognized 'status' in directory")
-        if sec['Valid-Until'] <= direc['Valid-After']:
+        if sec['Valid-Until'] <= sec['Valid-After']:
             raise ConfigError("Directory is never valid")
 
         self.voters = []
@@ -813,7 +813,7 @@
         idKeyBytes = sec['Directory-Identity'].get_modulus_bytes() 
         if not (2048 <= idKeyBytes*8 <= 4096):
             raise ConfigError("Identity key length is out of range (%s bits)"
-                              % idKeyBits*8)
+                              % idKeyBytes*8)
         if len(sec['Directory-Digest']) != DIGEST_LEN:
             raise ConfigError("Impossible digest length (%s)"%
                               len(sec['Directory-Digest']))