[Zodb-checkins] CVS: ZODB3/ZEO - StorageServer.py:1.66

Guido van Rossum guido@python.org
Tue, 17 Sep 2002 15:12:02 -0400


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

Modified Files:
	StorageServer.py 
Log Message:
ZEOStorage cleanliness nits:

- It never uses self.conn.  So don't store it.

- Make a check in register() that register() isn't called twice.  If
  it is, log a message and raise ValueError.


=== ZODB3/ZEO/StorageServer.py 1.65 => 1.66 ===
--- ZODB3/ZEO/StorageServer.py:1.65	Tue Sep 17 14:47:53 2002
+++ ZODB3/ZEO/StorageServer.py	Tue Sep 17 15:12:01 2002
@@ -120,13 +120,11 @@
     def __init__(self, server):
         self.server = server
         self.client = None
-        self.conn = None # the connection associated with client
         self.storage = None
         self.storage_id = "uninitialized"
         self.transaction = None
 
     def notifyConnected(self, conn):
-        self.conn = conn
         self.client = ClientStub.ClientStorage(conn)
 
     def notifyDisconnected(self):
@@ -187,6 +185,9 @@
         This method must be the first one called by the client.
         """
         self.log("register(%r, %s)" % (storage_id, read_only))
+        if self.storage is not None:
+            log("duplicate register() call")
+            raise ValueError, "duplicate register() call"
         storage = self.server.storages.get(storage_id)
         if storage is None:
             self.log("unknown storage_id: %s" % storage_id)