import optparse
from wizard import deploy
-
-import _base
-import migrate
+from wizard.command import _base
+from wizard.command import migrate
def massmigrate(argv, global_options, logger = None):
usage = """usage: %prog massmigrate [ARGS] APPLICATION
from wizard import deploy
from wizard import shell
-
-import _base
-import wizard
+from wizard.command import _base
class Error(_base.Error):
"""Base exception for all exceptions raised by migrate"""
def __str__(self):
return """
-ERROR: Directory already contains a .git directory.
-Did you already migrate it?
+ERROR: Directory already contains a .git and/or
+.scripts directory. Did you already migrate it?
"""
class NotAutoinstallError(Error):
# XXX: setup .scripts/version???
# for verbose purposes, give us a git status and git diff
if options.verbose:
- sh.call("git", "status")
- sh.call("git", "diff")
+ try:
+ sh.call("git", "status")
+ except shell.CalledProcessError:
+ pass
+ try:
+ sh.call("git", "diff")
+ except shell.CalledProcessError:
+ pass
except:
# this... is pretty bad
logger.critical("ERROR: Exception detected! Rolling back...")
import math
import fileinput
import dateutil.parser
-from distutils.version import LooseVersion as Version
+import distutils.version
def getInstallLines(global_options):
"""Retrieves a list of lines from the version directory that
self._c_exists = {}
def getVersion(self, version):
if version not in self.versions:
- self.versions[version] = ApplicationVersion(Version(version), self)
+ self.versions[version] = ApplicationVersion(distutils.version.LooseVersion(version), self)
return self.versions[version]
# XXX: This code should go in summary.py; maybe as a mixin, maybe as
# a visitor acceptor
import subprocess
-from subprocess import CalledProcessError, PIPE, STDOUT
import sys
+class CalledProcessError(subprocess.CalledProcessError):
+ pass
+
class Shell(object):
"""An advanced shell, with the ability to do dry-run and log commands"""
def __init__(self, logger = False, dry = False):
# output from Git work
proc = subprocess.Popen(args, stdout=sys.stdout, stderr=sys.stderr)
else:
- proc = subprocess.Popen(args, stdout=PIPE, stderr=STDOUT)
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
else:
proc = subprocess.Popen(args)
stdout, _ = proc.communicate()