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

[minion-cvs] Act sensibly when a downloaded directory is bad.



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

Modified Files:
	ClientDirectory.py 
Log Message:
Act sensibly when a downloaded directory is bad.

Index: ClientDirectory.py
===================================================================
RCS file: /home/minion/cvsroot/src/minion/lib/mixminion/ClientDirectory.py,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ClientDirectory.py	6 Mar 2004 05:15:40 -0000	1.35
+++ ClientDirectory.py	23 Mar 2004 00:35:07 -0000	1.36
@@ -8,7 +8,8 @@
      - address parsing.
 """
 
-__all__ = [ 'ClientDirectory', 'parsePath', 'parseAddress' ]
+__all__ = [ 'ClientDirectory', 'parsePath', 'parseAddress',
+            'GotInvalidDirectoryError' ]
 
 import cPickle
 import errno
@@ -44,6 +45,9 @@
 #XXXX "abstract server set", "directory-based server set", "disk-backed server
 #XXXX set", and "path generator".
 
+class GotInvalidDirectoryError(UIError):
+    """Raised when we have downloaded an invalid directory."""
+
 class ClientDirectory:
     """A ClientDirectory manages a list of server descriptors, either
        imported from the command line or from a directory."""
@@ -223,7 +227,8 @@
                 fname=fname,
                 validatedDigests=digestMap)
         except mixminion.Config.ConfigError, e:
-            raise MixFatalError("Downloaded invalid directory: %s" % e)
+            raise GotInvalidDirectoryError(
+                "Received an invalid directory: %s"%e)
 
         # Make sure that the identity is as expected.
         identity = directory['Signature']['DirectoryIdentity']