]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/upgrade.py
Change to production directory before running certain commands.
[wizard.git] / wizard / command / upgrade.py
index f397c08f527559ff325d6a539a36139807ac87fb..e31e7b935b9402ef51c01a673cc0b39171154b12 100644 (file)
@@ -115,11 +115,7 @@ class Upgrade(object):
         If we called ``--continue`` inside a production copy,  check if
         :file:`.wizard/pending` exists and change to that directory if so.
         """
-        # XXX: Can't use deploy; maybe should stringify constants?
-        if os.path.exists(".wizard/pending"):
-            newdir = open(".wizard/pending").read().strip()
-            logging.warning("Detected production copy; changing directory to %s", newdir)
-            os.chdir(newdir)
+        util.chdir_to_production()
     def resumeState(self):
         self.temp_wc_dir = os.getcwd()
         self.wc = deploy.WorkingCopy(".")