[Checkins] SVN: zope.app.generations/trunk/ Fixed bug: A failing last generation would allow starting an app server

Christian Theune ct at gocept.com
Wed Nov 12 13:37:23 EST 2008


Log message for revision 92894:
  Fixed bug: A failing last generation would allow starting an app server
  without having evolved to the minimum generation.
  

Changed:
  U   zope.app.generations/trunk/CHANGES.txt
  U   zope.app.generations/trunk/src/zope/app/generations/generations.py

-=-
Modified: zope.app.generations/trunk/CHANGES.txt
===================================================================
--- zope.app.generations/trunk/CHANGES.txt	2008-11-12 18:32:57 UTC (rev 92893)
+++ zope.app.generations/trunk/CHANGES.txt	2008-11-12 18:37:22 UTC (rev 92894)
@@ -2,6 +2,12 @@
 CHANGES
 =======
 
+3.4.2 (unreleased)
+------------------
+
+- Fixed bug: A failing last generation would allow starting an app server
+  without having evolved to the minimum generation.
+   
 3.4.1 (2007-10-31)
 ------------------
 

Modified: zope.app.generations/trunk/src/zope/app/generations/generations.py
===================================================================
--- zope.app.generations/trunk/src/zope/app/generations/generations.py	2008-11-12 18:32:57 UTC (rev 92893)
+++ zope.app.generations/trunk/src/zope/app/generations/generations.py	2008-11-12 18:37:22 UTC (rev 92894)
@@ -280,10 +280,10 @@
 
     If we set the minimum generation for app1 to something greater than 3:
 
-      >>> app1.minimum_generation = 5
+      >>> app1.minimum_generation = 4
 
     Then we'll get an error if we try to evolve, since we can't get
-    past 3 and 3 is less than 5:
+    past 3 and 3 is less than 4:
 
       >>> evolve(db)
       Traceback (most recent call last):
@@ -317,7 +317,7 @@
       >>> evolve(db, EVOLVENOT)
       Traceback (most recent call last):
       ...
-      GenerationTooLow: (3, u'app1', 5)
+      GenerationTooLow: (3, u'app1', 4)
 
     We got an error because we aren't at the minimum generation for
     app1.  The database generation for app1 is still 3 because we
@@ -335,9 +335,9 @@
       >>> evolve(db, EVOLVEMINIMUM)
       >>> conn.sync()
       >>> root[generations_key]['app1']
-      5
+      4
       >>> root.get('app1')
-      5
+      4
 
     If we happen to install an app that has a generation that is less
     that the database generation, we'll get an error, because there is
@@ -349,7 +349,7 @@
       >>> evolve(db)
       Traceback (most recent call last):
       ...
-      GenerationTooHigh: (5, u'app1', 2)
+      GenerationTooHigh: (4, u'app1', 2)
 
     We'd better clean up:
 
@@ -422,7 +422,7 @@
                         "Failed to evolve database to generation %d for %s",
                         generation, key)
 
-                    if generation < manager.minimum_generation:
+                    if generation <= manager.minimum_generation:
                         raise UnableToEvolve(generation, key,
                                              manager.generation)
                     break



More information about the Checkins mailing list