[Zodb-checkins] CVS: ZODB3/ZEO/auth - base.py:1.5.2.1

Jeremy Hylton jeremy at zope.com
Tue Dec 23 14:06:59 EST 2003


Update of /cvs-repository/ZODB3/ZEO/auth
In directory cvs.zope.org:/tmp/cvs-serv26665/ZEO/auth

Modified Files:
      Tag: ZODB3-mvcc-2-branch
	base.py 
Log Message:
Merge the head to the mvcc branch.

This merge should be the final preparation for merging the branch to
the trunk.


=== ZODB3/ZEO/auth/base.py 1.5 => 1.5.2.1 ===
--- ZODB3/ZEO/auth/base.py:1.5	Thu Oct  2 14:17:21 2003
+++ ZODB3/ZEO/auth/base.py	Tue Dec 23 14:05:56 2003
@@ -46,7 +46,7 @@
     usernames to password hashes. The hashes are SHA hex digests
     produced from the password string.
     """
-
+    realm = None
     def __init__(self, filename, realm=None):
         """Creates a new Database
 
@@ -59,8 +59,13 @@
         """
         self._users = {}
         self.filename = filename
-        self.realm = realm
         self.load()
+        if realm:
+            if self.realm and self.realm != realm:
+                raise ValueError, ("Specified realm %r differs from database "
+                                   "realm %r" % (realm or '', self.realm))
+            else:
+                self.realm = realm
 
     def save(self, fd=None):
         filename = self.filename




More information about the Zodb-checkins mailing list