- #: The value that failed to parse.
- value = None
- #: The location of the autoinstall that threw this variable.
- #: This should be set by error handling code when it is available.
- location = None
- def __init__(self, value):
- self.value = value
-
-class NoRepositoryError(Error):
- """
- :class:`Application` does not appear to have a Git repository
- in the normal location.
- """
- #: The name of the application that does not have a Git repository.
- app = None
- def __init__(self, app):
- self.app = app
-
-# If you want, you can wrap this up into a registry and access things
-# through that, but it's not really necessary
-
-_application_list = [
- "mediawiki", "wordpress", "joomla", "e107", "gallery2",
- "phpBB", "advancedbook", "phpical", "trac", "turbogears", "django",
- # these are technically deprecated
- "advancedpoll", "gallery",
-]
-_applications = None
-
-def applications():
- """Hash table for looking up string application name to instance"""
- global _applications
- if not _applications:
- _applications = dict([(n,Application.make(n)) for n in _application_list ])
- return _applications
-
+ #: Directory of deployment
+ dir = None
+ def __init__(self, dir):
+ self.dir = dir
+ def __str__(self):
+ return """This installation was not migrated"""
+
+class AlreadyVersionedError(Error):
+ """The deployment contained a .git directory but no .wizard directory."""
+ #: Directory of deployment
+ dir = None
+ def __init__(self, dir):
+ self.dir = dir
+ def __str__(self):
+ return """
+
+ERROR: Directory contains a .git directory, but not
+a .wizard directory. If this is not a corrupt
+migration, this means that the user was versioning their
+install using Git."""
+
+class NotConfiguredError(Error):
+ """The install was missing essential configuration."""
+ #: Directory of unconfigured install
+ dir = None
+ def __init__(self, dir):
+ self.dir = dir
+ def __str__(self):
+ return """
+
+ERROR: The install was well-formed, but not configured
+(essential configuration files were not found.)"""
+
+class CorruptedAutoinstallError(Error):
+ """The install was missing a .git directory, but had a .wizard directory."""
+ #: Directory of the corrupted install
+ dir = None
+ def __init__(self, dir):
+ self.dir = dir
+ def __str__(self):
+ return """
+
+ERROR: Directory contains a .wizard directory,
+but not a .git directory."""
+
+class NotAutoinstallError(Error):
+ """Application is not an autoinstall."""
+ #: Directory of the not autoinstall
+ dir = None
+ def __init__(self, dir):
+ self.dir = dir
+ def __str__(self):
+ return """
+
+ERROR: The directory
+
+ %s
+
+does not appear to be an autoinstall. If you are in a
+subdirectory of an autoinstall, you need to use the root
+directory for the autoinstall.""" % self.dir
+
+class NoTagError(Error):
+ """Deployment has a tag that does not have an equivalent in upstream repository."""
+ #: Missing tag
+ tag = None
+ def __init__(self, tag):
+ self.tag = tag
+ def __str__(self):
+ return """
+
+ERROR: Could not find tag %s in repository.""" % self.tag
+
+class NoLocalTagError(Error):
+ """Could not find tag in local repository."""
+ #: Missing tag
+ tag = None
+ def __init__(self, tag):
+ self.tag = tag
+ def __str__(self):
+ return """
+
+ERROR: Could not find tag %s in local repository.""" % self.tag
+
+class InconsistentPristineTagError(Error):
+ """Pristine tag commit ID does not match upstream pristine tag commit ID."""
+ #: Inconsistent tag
+ tag = None
+ def __init__(self, tag):
+ self.tag = tag
+ def __str__(self):
+ return """
+
+ERROR: Local pristine tag %s did not match repository's. This
+probably means an upstream rebase occured.""" % self.tag
+
+class InconsistentWizardTagError(Error):
+ """Wizard tag commit ID does not match upstream wizard tag commit ID."""
+ #: Inconsistent tag
+ tag = None
+ def __init__(self, tag):
+ self.tag = tag
+ def __str__(self):
+ return """
+
+ERROR: Local wizard tag %s did not match repository's. This
+probably means an upstream rebase occurred.""" % self.tag
+
+class HeadNotDescendantError(Error):
+ """HEAD is not connected to tag."""
+ #: Tag that HEAD should have been descendant of.
+ tag = None
+ def __init__(self, tag):
+ self.tag = tag
+ def __str__(self):
+ return """
+
+ERROR: HEAD is not a descendant of %s. This probably
+means that an upstream rebase occurred, and new tags were
+pulled, but local user commits were never rebased.""" % self.tag
+
+class VersionDetectionError(Error):
+ """Could not detect real version of application."""
+ def __str__(self):
+ return """
+
+ERROR: Could not detect the real version of the application."""
+
+class VersionMismatchError(Error):
+ """Git version of application does not match detected version."""
+ #: Detected version
+ real_version = None
+ #: Version from Git
+ git_version = None
+ def __init__(self, real_version, git_version):
+ self.real_version = real_version
+ self.git_version = git_version
+ def __str__(self):
+ return """
+
+ERROR: The detected version %s did not match the Git
+version %s.""" % (self.real_version, self.git_version)
+
+class WebVerificationError(Error):
+ """Could not access the application on the web"""
+ def __str__(self):
+ return """
+
+ERROR: We were not able to access the application on the
+web. This may indicate that the website is behind
+authentication on the htaccess level. You can find
+the contents of the page from the debug backtraces."""
+
+class DatabaseVerificationError(Error):
+ """Could not access the database"""
+ def __str__(self):
+ return """
+
+ERROR: We were not able to access the database for
+this application; this probably means that your database
+configuration is misconfigured."""
+
+class UnknownWebPath(Error):
+ """Could not determine application's web path."""
+ def __str__(self):
+ return """
+
+ERROR: We were not able to determine what the application's
+host and path were in order to perform a web request
+on the application. You can specify this manually using
+the WIZARD_WEB_HOST and WIZARD_WEB_PATH environment
+variables."""