if options.force_version:
version = deployment.application.makeVersion(options.force_version)
else:
- deployment.verifyVersion()
- version = deployment.app_version
+ try:
+ deployment.verifyVersion()
+ version = deployment.app_version
+ except deploy.VersionMismatchError as e:
+ # well, we'll use that then
+ version = deployment.application.makeVersion(str(e.real_version))
repo = version.application.repository(options.srv_path)
tag = version.scripts_tag
+ try:
+ sh.call("git", "--git-dir=%s" % repo, "rev-parse", tag)
+ except shell.CallError:
+ raise UnsupportedVersion(version.version)
with util.LockDirectory(".scripts-migrate-lock"):
try:
.scripts directories (i.e. your history and Wizard configuration).)
"""
+class UnsupportedVersion(Error):
+ def __init__(self, version):
+ self.version = version
+ def __str__(self):
+ return """
+
+ERROR: This autoinstall is presently on %s, which is unsupported by
+Wizard. Please manually upgrade it to one that is supported,
+and then retry the migration; usually the latest version is supported.
+""" % self.version