api_errors.py revision 1191
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# CDDL HEADER START
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen# The contents of this file are subject to the terms of the
e015e2f7e7f48874495f9df8b0dd192b7ffcb5ccTimo Sirainen# Common Development and Distribution License (the "License").
58be9d6bcc3800f5b3d76a064ee767fbe31a5a8aTimo Sirainen# You may not use this file except in compliance with the License.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# See the License for the specific language governing permissions
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# and limitations under the License.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
ab1e5b156d1b5480d36ed6e8e06197339d803038Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
ab1e5b156d1b5480d36ed6e8e06197339d803038Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# CDDL HEADER END
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen# Use is subject to license terms.
6bc0f424bcdb9119d8159874cf98adfa53eefd9aTimo Sirainen# EmptyI for argument defaults; can't import from misc due to circular
d35fee8d1e5e31614dba5e64d45ed23c7d6bfa53Timo Sirainen """Used when an image was not found"""
d35fee8d1e5e31614dba5e64d45ed23c7d6bfa53Timo Sirainen def __init__(self, user_specified, user_dir, root_dir):
eddd9bf1a1369aea4a2715f6be1137da6d17d293Timo Sirainen def __init__(self, expected_version, received_version):
5bd1c1d4fe3265d5e6b6054044fd6d78e42c9d0aTimo Sirainenclass PrematureExecutionException(ApiException):
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenclass ImageUpdateOnLiveImageException(ApiException):
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainenclass NoPackagesInstalledException(ApiException):
abe7afb8f1766fbcef1b9df513109e43d7d16e49Timo Sirainen return _("Could not operate on %s\nbecause of "
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen "insufficient permissions. Please try the command "
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen "again using pfexec\nor otherwise increase your "
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo SirainenCould not complete the operation because of insufficient permissions. Please
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainentry the command again using pfexec or otherwise increase your privileges.
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainenclass FileInUseException(PermissionsException):
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen return _("Could not operate on %s\nbecause the file is "
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen "in use. Please stop using the file and try the\n"
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen def __init__(self, unmatched_fmris=EmptyI, multiple_matches=EmptyI,
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen constraint_violations=EmptyI, badarch=EmptyI):
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen self.constraint_violations = constraint_violations
2131ef7a3390f15ea6a958256ea54908f1096350Timo SirainenThe following pattern(s) did not match any packages in the current catalog.
69e03a846f6980144aa75bff0590c04852bffbbcTimo SirainenTry relaxing the pattern, refreshing and/or examining the catalogs:""")
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen res += ["\t%s" % p for p in self.unmatched_fmris]
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen s = _("'%s' matches multiple packages")
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen s = _("'%s' matches no installed packages")
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen res += [ s % p for p in self.missing_matches ]
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen s = _("'%s' is an illegal fmri")
04b8a90af181cc4c7959266855e8ed50a22ed413Timo Sirainen s = _("The following package(s) violated constraints:")
2131ef7a3390f15ea6a958256ea54908f1096350Timo Sirainen res += ["\t%s" % p for p in self.constraint_violations]
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen s = _("'%s' supports the following architectures: %s")
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen a = _("Image architecture is defined as: %s")
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen """An error was encountered executing an action.
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen In particular, this exception indicates that something went wrong in the
85da8c055280cd45553b6b335e9fb226d6e2801eTimo Sirainen application (or unapplication) of the action to the system, not an error
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen in the pkg(5) code.
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen The 'msg' argument can provide a more specific message than what would
bc564f1d3d953cf724828322b11ae89e0f59ffc9Timo Sirainen be returned from, and 'ignoreerrno' can be set to True to indicate that
2131ef7a3390f15ea6a958256ea54908f1096350Timo Sirainen the sterror() text is misleading, and shouldn't be displayed.
69e03a846f6980144aa75bff0590c04852bffbbcTimo Sirainen def __init__(self, action, exception, msg=None, ignoreerrno=False):
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen if not self.ignoreerrno and hasattr(self.exception, "errno"):
fd2f5fbc1f07aa93e2214a28cdf02437fb7d06c8Timo Sirainen errno = "[errno %d: %s]" % (self.exception.errno,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen # Fall back on the wrapped exception if we don't have anything
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5dTimo Sirainen # If we only have one of the two, no need for the colon.
6b85bc4b03e552cfaeeae872d63c2d8ac5fcb7c4Timo Sirainen """Base class used for all catalog cache errors."""
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainenclass CatalogCacheBadVersion(CatalogCacheError):
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen """Used to indicate that the catalog cache is invalid or is not of a
620b5ed41650da63b0ba15c489f9f312231d5d9bTimo Sirainen supported version."""
25c22e54d1071d120641e9eecd0023e7373e65ffTimo Sirainen return _("Unsupported catalog cache Version: '%(found)s'; "
25c22e54d1071d120641e9eecd0023e7373e65ffTimo Sirainen "expected: '%(expected)s'") % { "found": self.data,
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that the catalog cache is corrupt or otherwise
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen unparseable."""
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen return _("Catalog cache is corrupt or invalid; error "
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen "encountered while reading:\nline %(lnum)d: '%(data)s'") % {
25c22e54d1071d120641e9eecd0023e7373e65ffTimo Sirainen "lnum": self.args["line_number"], "data": self.data }
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen """Used to indicate that the catalog cache is missing."""
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen return _("Catalog cache is missing.")
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen def __init__(self, failed, total, succeeded, message=None):
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen def __init__(self, notfound=EmptyI, illegal=EmptyI):
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen # Illegal FMRIs have their own __str__ method
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen outstr += _("No matching package could be found for "
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen "the following FMRIs in any of the catalogs for "
f0ff961282e618945dfe997dc45ff95d656e5790Timo Sirainen "the current publishers:\n")
8ac66221e8fdc2c5523cff1893e0d1c5de25fa49Timo Sirainen# SearchExceptions
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Based class used for all search-related api exceptions."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenclass MainDictParsingException(SearchException):
920b9f0fdfa5a5d7763e05736601a31bcb291a53Timo Sirainen """This is used when the main dictionary could not parse a line."""
a40d26f83af808a0ea1e212c001d682a96d870b0Timo Sirainen """Raised when the server cannot understand the format of the
f501ad38c51cf1d8f4f84313922c785e6ae6e81fTimo Sirainen search request."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Returned when the search cannot find any matches."""
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainen return _("The search at url %s returned no results.") % self.url
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainenclass ProblematicSearchServers(SearchException):
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen """This class wraps exceptions which could appear while trying to
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen do a search request."""
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen def __init__(self, failed=EmptyI, invalid=EmptyI, unsupported=EmptyI):
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainen s = _("Some servers failed to respond appropriately:\n")
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainen s += _("%(o)s:\n%(msg)s\n") % \
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen s += _("%s did not return a valid response.\n" \
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainen s += _("Some servers don't support requested search"
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen " operation:\n")
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen s += _("%(o)s:\n%(msg)s\n") % \
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen """This exception is thrown when a local search is performed without
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen an index. It's raised after all results have been yielded."""
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen return _("Search performance is degraded.\n"
1098fc409a45e7603701dc94635927a673bee0c1Timo Sirainen "Run 'pkg rebuild-index' to improve search speed.")
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen """Returned when a search protocol is not supported by the
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen remote server."""
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen s = _("Search server does not support the requested protocol:")
ab1e5b156d1b5480d36ed6e8e06197339d803038Timo Sirainen if not isinstance(other, UnsupportedSearchError):
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen# IndexingExceptions.
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen """ The base class for all exceptions that can occur while indexing. """
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainenclass CorruptedIndexException(IndexingException):
dad1d7b721e80a7e6c0282ace93aef86312fa579Timo Sirainen """This is used when the index is not in a correct state."""
82ed69779f49bd71ef1b570ce8aca67d357dbee8Timo Sirainenclass InconsistentIndexException(IndexingException):
82ed69779f49bd71ef1b570ce8aca67d357dbee8Timo Sirainen """This is used when the existing index is found to have inconsistent
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainenclass ProblematicPermissionsIndexException(IndexingException):
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen """ This is used when the indexer is unable to create, move, or remove
97144a346898fb62f9fae44fa5c076986553c66bTimo Sirainen files or directories it should be able to. """
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen return "Could not remove or create " \
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen "%s because of incorrect " \
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen "permissions. Please correct this issue then " \
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen# Query Parsing Exceptions
9bd08aa09ea0cbd7b221aae9fc0534eb762d3de6Timo Sirainen """This exception is used when the children of a boolean operation
97144a346898fb62f9fae44fa5c076986553c66bTimo Sirainen have different return types. The command 'pkg search foo AND <bar>'
97144a346898fb62f9fae44fa5c076986553c66bTimo Sirainen is the simplest example of this."""
1098fc409a45e7603701dc94635927a673bee0c1Timo Sirainen """Removal of a package which satisfies dependencies has been attempted.
1098fc409a45e7603701dc94635927a673bee0c1Timo Sirainen The first argument to the constructor is the FMRI which we tried to
8ac66221e8fdc2c5523cff1893e0d1c5de25fa49Timo Sirainen remove, and is available as the "fmri" member of the exception. The
8ac66221e8fdc2c5523cff1893e0d1c5de25fa49Timo Sirainen second argument is the list of dependent packages that prevent the
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen removal of the package, and is available as the "dependents" member.
de9b2ee7878a73346ba0eee34798abb22ffcfcb6Timo Sirainenclass InvalidDepotResponseException(ApiException):
82ed69779f49bd71ef1b570ce8aca67d357dbee8Timo Sirainen """Raised when the depot doesn't have versions of operations
82ed69779f49bd71ef1b570ce8aca67d357dbee8Timo Sirainen that the client needs to operate successfully."""
fd2f5fbc1f07aa93e2214a28cdf02437fb7d06c8Timo Sirainen s = "Unable to contact valid package server"
4b231ca0bbe3b536acbd350101e183441ce0247aTimo Sirainen s += "\nEncountered the following error(s):\n%s" % \
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Base exception class used for all data related errors."""
e9594e86dc601b72c1636f2b901dcfbf4ffaf47fAki Tuomi """Used to indicate that the specified location does not contain a
e9594e86dc601b72c1636f2b901dcfbf4ffaf47fAki Tuomi valid p5i-formatted file."""
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen return _("The specified file is in an unrecognized "
18d92dbbb752c79dc461514e52f7ef11847e636bTimo Sirainen "format or does not contain valid publisher "
f81801789c71f64a2fc3c44d09f9864bbc68cd45Timo Sirainen return _("The specified file is in an unrecognized format or "
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen "does not contain valid publisher information.")
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen """Used to indicate that an attempt to read an unsupported version
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen of pkg(5) info file was attempted."""
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen return _("Unsupported pkg(5) publisher information data "
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen """Abstract exception class for all transport exceptions.
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen Specific transport exceptions should be implemented in the
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen transport code. Callers wishing to catch transport exceptions
6a8a4c9f530668cd8961b73d702856ed94f05f80Timo Sirainen should use this class. Subclasses must implement all methods
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen defined here that raise NotImplementedError."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Used to indicate that a a requested resource could not be
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen retrieved."""
66ecc94150cbce23aad3240135e0782e0a74d479Timo Sirainen return _("Error encountered while retrieving data from "
036626b19f14bef582f96e556913ae91b1d67881Timo Sirainen return _("Error encountered while retrieving data from: %s") % \
66ecc94150cbce23aad3240135e0782e0a74d479Timo Sirainen """Used to indicate that an invalid transport location was provided."""
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen return _("'%s' is not a valid location.") % self.data
f239eb76f77afcbc0bfc97c9b52b4407d1bc3fe6Timo Sirainen return _("'%s' is not a valid boot environment name.") % \
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5dTimo Sirainen """Used to indicate that there is an existing boot environment
d5cebe7f98e63d4e2822863ef2faa4971e8b3a5dTimo Sirainen with this name"""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen return _("The boot environment '%s' already exists.") % \
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen return _("""\
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo SirainenBoot environment naming during package install is not supported on this
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenversion of OpenSolaris. Please image-update without the --be-name option.""")
51b979b6414b940f04677a7e2d064be119345954Timo Sirainen return _("Unable to clone the current boot environment.")
51b979b6414b940f04677a7e2d064be119345954Timo Sirainen return _("""\
51b979b6414b940f04677a7e2d064be119345954Timo SirainenA problem occurred while attempting to rename the boot environment
036626b19f14bef582f96e556913ae91b1d67881Timo Sirainencurrently named %(orig)s to %(dest)s.""") % d
d0bbbc7057aa33b52ee378196dee7d773437468fTimo Sirainen return _("Unable to mount %(name)s at %(mt)s") % \
4aae8acbcfa9cac96b4af39bfabcbe569e804827Timo Sirainen return _("""\
4aae8acbcfa9cac96b4af39bfabcbe569e804827Timo SirainenNaming a boot environment when operating on a non-live image is
51b979b6414b940f04677a7e2d064be119345954Timo Sirainennot allowed.""")
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen s = _("Info does not recognize the following options:")
2af769daebd83719ac696a440e06f6020471cec0Timo Sirainen """This is used when the index hash value doesn't match the hash of the
d0bbbc7057aa33b52ee378196dee7d773437468fTimo Sirainen packages installed in the image."""
df6478c4cf605bd81b3891c148b84c14eb6c4035Timo Sirainen """Base exception class for all publisher exceptions."""
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen """Used to indicate an operation on the publisher's meta_root failed
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen because the meta_root is invalid."""
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen return _("Publisher meta_root '%(root)s' is invalid; unable "
fd2f5fbc1f07aa93e2214a28cdf02437fb7d06c8Timo Sirainen "to complete operation: '%(op)s'.") % { "root": self.data,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Used to indicate that a publisher name is not valid."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen return _("'%s' is not a valid publisher name.") % self.data
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainenclass BadRepositoryAttributeValue(PublisherError):
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen """Used to indicate that the specified repository attribute value is
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen return _("'%(value)s' is not a valid value for repository "
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen "attribute '%(attribute)s'.") % {
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen "value": self.args["value"], "attribute": self.data }
425cbcea60cf689b0069698c83f8bdc474d70693Timo Sirainenclass BadRepositoryCollectionType(PublisherError):
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen """Used to indicate that the specified repository collection type is
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen PublisherError.__init__(self, *args, **kwargs)
1098fc409a45e7603701dc94635927a673bee0c1Timo Sirainen return _("'%s' is not a valid repository collection type.") % \
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen """Used to indicate that a repository URI is not syntactically valid."""
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen return _("'%s' is not a valid URI.") % self.data
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainenclass BadRepositoryURIPriority(PublisherError):
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen """Used to indicate that the priority specified for a repository URI is
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen not valid."""
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainen return _("'%s' is not a valid URI priority; integer value "
ab70f55bb8d824ca1ed7c74196f2f502edd29cc7Timo Sirainenclass BadRepositoryURISortPolicy(PublisherError):
d0bbbc7057aa33b52ee378196dee7d773437468fTimo Sirainen """Used to indicate that the specified repository URI sort policy is
d0bbbc7057aa33b52ee378196dee7d773437468fTimo Sirainen PublisherError.__init__(self, *args, **kwargs)
d0bbbc7057aa33b52ee378196dee7d773437468fTimo Sirainen return _("'%s' is not a valid repository URI sort policy.") % \
a817fdcc43aedf423e2134091d5f83f91d64bcc9Timo Sirainen """Used to indicate that an attempt to use a disabled publisher occurred
72cbf33ae81fde08384d30c779ff540752d9256cTimo Sirainen during an operation."""
a817fdcc43aedf423e2134091d5f83f91d64bcc9Timo Sirainen return _("Publisher '%s' is disabled and cannot be used for "
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that a publisher with the same name or alias already
a817fdcc43aedf423e2134091d5f83f91d64bcc9Timo Sirainen exists for an image."""
72cbf33ae81fde08384d30c779ff540752d9256cTimo Sirainen return _("A publisher with the same name or alias as '%s' "
f501ad38c51cf1d8f4f84313922c785e6ae6e81fTimo Sirainen """Used to indicate that a repository with the same origin uris
1098fc409a45e7603701dc94635927a673bee0c1Timo Sirainen already exists for a publisher."""
b780aa272b742a43579cdb523cc79cc8d4521306Timo Sirainen return _("A repository with the same name or origin URIs "
51b979b6414b940f04677a7e2d064be119345954Timo Sirainen "already exists for publisher '%s'.") % self.data
51b979b6414b940f04677a7e2d064be119345954Timo Sirainenclass DuplicateRepositoryMirror(PublisherError):
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that a repository URI is already in use by another
d9fdacd5fb3e07997e5c389739d2054f0c8441d8Timo Sirainen repository mirror."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen return _("Mirror '%s' already exists for the specified "
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainenclass DuplicateRepositoryOrigin(PublisherError):
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that a repository URI is already in use by another
dbd9604da561399cc6255289d5b6f6f662ab2d00Timo Sirainen repository origin."""
dbd9604da561399cc6255289d5b6f6f662ab2d00Timo Sirainen return _("Origin '%s' already exists for the specified "
bba52ecbb0cfb6585f1a4ff29695dd2d27af98d2Timo Sirainenclass RemovePreferredPublisher(PublisherError):
bba52ecbb0cfb6585f1a4ff29695dd2d27af98d2Timo Sirainen """Used to indicate an attempt to remove the preferred publisher was
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen return _("The preferred publisher cannot be removed.")
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainenclass SelectedRepositoryRemoval(PublisherError):
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that an attempt to remove the selected repository
131b073bdc3650083b00616dc778dd3017c2bbb5Timo Sirainen for a publisher was made."""
131b073bdc3650083b00616dc778dd3017c2bbb5Timo Sirainen return _("Cannot remove the selected repository for a "
131b073bdc3650083b00616dc778dd3017c2bbb5Timo Sirainen "publisher.")
044b0557e92ae0bb3b25af49d5468bad3d17db43Timo Sirainenclass SetPreferredPublisherDisabled(PublisherError):
044b0557e92ae0bb3b25af49d5468bad3d17db43Timo Sirainen """Used to indicate an attempt to set a disabled publisher as the
044b0557e92ae0bb3b25af49d5468bad3d17db43Timo Sirainen preferred publisher was made."""
044b0557e92ae0bb3b25af49d5468bad3d17db43Timo Sirainen return _("Publisher '%s' is disabled and cannot be set as the "
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that no matching legal URI could be found using the
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen provided criteria."""
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen return _("Unknown legal URI '%s'.") % self.data
289064eb21595d3e4460439eccdc48232d13f5e1Timo Sirainen """Used to indicate that no matching publisher could be found using the
f3976df875193529127d584cb713983e8160bdcfTimo Sirainen provided criteria."""
f3976df875193529127d584cb713983e8160bdcfTimo Sirainen return _("Unknown publisher '%s'.") % self.data
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Used to indicate that no matching related URI could be found using
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen the provided criteria."""
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen return _("Unknown related URI '%s'.") % self.data
4b058f90f9e8a2c6b2eed275de4eb8cc5195a71dTimo Sirainen """Used to indicate that no matching repository could be found using the
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen provided criteria."""
128ea07dab8d67124ea74bcc085a478784b6358aTimo Sirainen return _("Unknown repository '%s'.") % self.data
6f73af3a3a6ee900c7e736874587968d76a20bc0Timo Sirainen """Used to indicate that a repository URI could not be found in the
6f73af3a3a6ee900c7e736874587968d76a20bc0Timo Sirainen list of repository mirrors."""
5724e7103eed12fe36b55a7b5a8653284a2184b9Timo Sirainen return _("Unknown repository mirror '%s'.") % self.data
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen """Used to indicate that a repository URI could not be found in the
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen list of repository origins."""
8fa86f7ef06aa6cf0239c7ca2eb98889691d40d4Timo Sirainen return _("Unknown repository origin '%s'") % self.data
8fa86f7ef06aa6cf0239c7ca2eb98889691d40d4Timo Sirainenclass UnsupportedRepositoryURI(PublisherError):
8fa86f7ef06aa6cf0239c7ca2eb98889691d40d4Timo Sirainen """Used to indicate that the specified repository URI uses an
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainen unsupported scheme."""
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainen return _("The URI '%(uri)s' contains an unsupported "
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainen return _("The specified URI contains an unsupported scheme.")
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainenclass UnsupportedRepositoryURIAttribute(PublisherError):
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainen """Used to indicate that the specified repository URI attribute is not
956f7778e413d3184d69e7b96e4a6b3cd5570bcdTimo Sirainen supported for the URI's scheme."""
if args:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri: