[CalendarServer-changes] [12864] CalendarServer/trunk/calendarserver/tools/upgrade.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Mar 10 10:52:26 PDT 2014


Revision: 12864
          http://trac.calendarserver.org//changeset/12864
Author:   cdaboo at apple.com
Date:     2014-03-10 10:52:25 -0700 (Mon, 10 Mar 2014)
Log Message:
-----------
Properly handle case where the store is None.

Modified Paths:
--------------
    CalendarServer/trunk/calendarserver/tools/upgrade.py

Modified: CalendarServer/trunk/calendarserver/tools/upgrade.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/upgrade.py	2014-03-10 16:16:13 UTC (rev 12863)
+++ CalendarServer/trunk/calendarserver/tools/upgrade.py	2014-03-10 17:52:25 UTC (rev 12864)
@@ -142,21 +142,27 @@
         """
         Immediately stop.  The upgrade will have been run before this.
         """
-        if self.store is None:
-            if self.options["status"]:
-                self.output.write("Upgrade needed.\n")
-            else:
-                self.output.write("Upgrade failed.\n")
+        # If we get this far the database is OK
+        if self.options["status"]:
+            self.output.write("Database OK.\n")
         else:
-            # If we get this far the database is OK
-            if self.options["status"]:
-                self.output.write("Database OK.\n")
-            else:
-                self.output.write("Upgrade complete, shutting down.\n")
+            self.output.write("Upgrade complete, shutting down.\n")
         UpgraderService.started = True
         return succeed(None)
 
 
+    def doWorkWithoutStore(self):
+        """
+        Immediately stop.  The upgrade will have been run before this.
+        """
+        if self.options["status"]:
+            self.output.write("Upgrade needed.\n")
+        else:
+            self.output.write("Upgrade failed.\n")
+        UpgraderService.started = True
+        return succeed(None)
+
+
     def postStartService(self):
         """
         Quit right away
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140310/98fdba21/attachment-0001.html>


More information about the calendarserver-changes mailing list