api_errors.py revision 1372
565N/A# The contents of this file are subject to the terms of the 565N/A# Common Development and Distribution License (the "License"). 565N/A# You may not use this file except in compliance with the License. 565N/A# See the License for the specific language governing permissions 565N/A# and limitations under the License. 565N/A# When distributing Covered Code, include this CDDL HEADER in each 565N/A# If applicable, add the following below this CDDL HEADER, with the 565N/A# fields enclosed by brackets "[]" replaced with your own identifying 565N/A# information: Portions Copyright [yyyy] [name of copyright owner] 835N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 565N/A# Use is subject to license terms. 926N/A# EmptyI for argument defaults; can't import from misc due to circular 565N/A """Used when an image was not found""" 1369N/A return _(
"Invalid package state change attempted '%(states)s' " 926N/A return _(
"Could not operate on %s\nbecause of " 926N/A "insufficient permissions. Please try the command " 926N/A "again using pfexec\nor otherwise increase your " 685N/ACould not complete the operation because of insufficient permissions. Please 926N/Atry the command again using pfexec or otherwise increase your privileges. 879N/A return _(
"Could not operate on %s\nbecause the file is " 879N/A "in use. Please stop using the file and try the\n" 1335N/A """Used to indicate that the operation was attempted on a 1335N/A return _(
"Could not complete the operation on %s: " 1335N/A return _(
"Could not complete the operation: read-only " 988N/AThe following pattern(s) did not match any packages in the current catalog. 988N/ATry relaxing the pattern, refreshing and/or examining the catalogs:""")
988N/A s = _(
"'%s' matches multiple packages")
988N/A s = _(
"'%s' matches no installed packages")
988N/A s = _(
"'%s' is an illegal fmri")
988N/A s = _(
"The following package(s) violated constraints:")
838N/A s = _(
"'%s' supports the following architectures: %s")
838N/A a = _(
"Image architecture is defined as: %s")
1352N/A s = _(
"The proposed operation can not be performed for " 1352N/A "the following package(s) as they are not " 1352N/A s = _(
"The proposed operation can not be performed for " 1352N/A "the following package(s) as they are already " 1050N/A """An error was encountered executing an action. 1050N/A In particular, this exception indicates that something went wrong in the 1050N/A application (or unapplication) of the action to the system, not an error 1050N/A The 'msg' argument can provide a more specific message than what would 1050N/A be returned from, and 'ignoreerrno' can be set to True to indicate that 1050N/A the sterror() text is misleading, and shouldn't be displayed. 1050N/A # Fall back on the wrapped exception if we don't have anything 1050N/A # If we only have one of the two, no need for the colon. 1352N/A """Base exception class for all catalog exceptions.""" 1352N/A """Used to indicate that the specified FMRI is not valid for catalog 1352N/A operations because it is missing publisher information.""" 1352N/A return _(
"The FMRI '%s' does not contain publisher information " 1352N/A """Used to indicate an operation on the catalog's meta_root failed 1352N/A because the meta_root is invalid.""" 1352N/A return _(
"Catalog meta_root '%(root)s' is invalid; unable " 1352N/A """Used to indicate the server catalog files do not have the expected 1352N/A """files should contain a list object with each entry consisting 1352N/A of a tuple of filename, expected_mode, received_mode.""" 1352N/A msg = _(
"The following catalog files have incorrect " 1352N/A msg += _(
"\t%(fname)s: expected mode: %(emode)s, found " 1352N/A """Used to indicate that the Catalog signatures are not valid.""" 1352N/A return _(
"The signature data for the '%s' catalog file is not " 1352N/A """Used to indicate that the requested catalog updates could not be 1352N/A applied as the new catalog data is significantly different such that 1352N/A the old catalog cannot be updated to match it.""" 1352N/A return _(
"Unable to determine the updates needed for " 1352N/A "the current catalog using the provided catalog " 1352N/A """Used to indicate that the specified catalog operation could not be 1352N/A performed since it would result in a duplicate catalog entry.""" 1352N/A return _(
"Unable to perform '%(op)s' operation for catalog " 1352N/A "%(name)s; completion would result in a duplicate entry " 1352N/A """Used to indicate that an update request for the catalog could not 1352N/A be performed because update requirements were not satisfied.""" 1352N/A return _(
"Catalog updates can only be applied to an on-disk " 1352N/A """Used to indicate a Catalog file could not be loaded.""" 1352N/A """Used to indicate that the specified catalog updates are for an older 1352N/A version of the catalog and cannot be applied.""" 1352N/A return _(
"Unable to determine the updates needed for the " 1352N/A "catalog using the provided catalog update data in '%s'. " 1352N/A "The specified catalog updates are for an older version " 1352N/A """Used to indicate that an entry for the specified package FMRI or 1352N/A pattern could not be found in the catalog.""" 1352N/A """Used to indicate that the specified CatalogUpdate operation is 1352N/A """Used to indicate that some of the specified patterns to a catalog 1352N/A matching function did not match any catalog entries.""" 596N/A # Illegal FMRIs have their own __str__ method 614N/A outstr += _(
"No matching package could be found for " 614N/A "the following FMRIs in any of the catalogs for " 926N/A "the current publishers:\n")
1027N/A """Based class used for all search-related api exceptions.""" 1191N/A """This is used when the main dictionary could not parse a line.""" 1191N/A """Raised when the server cannot understand the format of the 1191N/A """Returned when the search cannot find any matches.""" 1191N/A return _(
"The search at url %s returned no results.") %
self.
url 1191N/A """This class wraps exceptions which could appear while trying to 1191N/A s = _(
"Some servers failed to respond appropriately:\n")
1191N/A s += _(
"%(o)s:\n%(msg)s\n") % \
1191N/A s += _(
"%s did not return a valid response.\n" \
1191N/A s += _(
"Some servers don't support requested search" 1191N/A s += _(
"%(o)s:\n%(msg)s\n") % \
1191N/A """This exception is thrown when a local search is performed without 1191N/A an index. It's raised after all results have been yielded.""" 1191N/A return _(
"Search performance is degraded.\n" 1191N/A "Run 'pkg rebuild-index' to improve search speed.")
1191N/A """Returned when a search protocol is not supported by the 1191N/A s = _(
"Search server does not support the requested protocol:")
565N/A """ The base class for all exceptions that can occur while indexing. """ 565N/A """This is used when the index is not in a correct state.""" 1191N/A """This is used when the existing index is found to have inconsistent 565N/A """ This is used when the indexer is unable to create, move, or remove 565N/A files or directories it should be able to. """ 565N/A return "Could not remove or create " \
565N/A "%s because of incorrect " \
565N/A "permissions. Please correct this issue then " \
1286N/A """This exception is used to wrap an indexing exception during install, 1286N/A uninstall, or image-update so that a more appropriate error message 1286N/A can be displayed to the user.""" 1286N/A """This exception is used to wrap an indexing exception during install, 1286N/A uninstall, or image-update which was recovered from by performing a 1191N/A """This exception is used when the children of a boolean operation 1191N/A have different return types. The command 'pkg search foo AND <bar>' 1191N/A is the simplest example of this.""" 565N/A """Removal of a package which satisfies dependencies has been attempted. 565N/A The first argument to the constructor is the FMRI which we tried to 565N/A remove, and is available as the "fmri" member of the exception. The 565N/A second argument is the list of dependent packages that prevent the 565N/A removal of the package, and is available as the "dependents" member. 835N/A """Raised when the depot doesn't have versions of operations 835N/A that the client needs to operate successfully.""" 835N/A s =
"Unable to contact valid package server" 835N/A s +=
"\nEncountered the following error(s):\n%s" % \
926N/A """Base exception class used for all data related errors.""" 926N/A """Used to indicate that the specified location does not contain a 926N/A valid p5i-formatted file.""" 926N/A return _(
"The specified file is in an unrecognized " 926N/A "format or does not contain valid publisher " 926N/A return _(
"The specified file is in an unrecognized format or " 926N/A "does not contain valid publisher information.")
926N/A """Used to indicate that an attempt to read an unsupported version 926N/A of pkg(5) info file was attempted.""" 926N/A return _(
"Unsupported pkg(5) publisher information data " 1191N/A """Abstract exception class for all transport exceptions. 1191N/A Specific transport exceptions should be implemented in the 1191N/A transport code. Callers wishing to catch transport exceptions 1191N/A should use this class. Subclasses must implement all methods 1191N/A defined here that raise NotImplementedError.""" 926N/A """Used to indicate that a a requested resource could not be 926N/A return _(
"Error encountered while retrieving data from " 926N/A return _(
"Error encountered while retrieving data from: %s") % \
926N/A """Used to indicate that an invalid transport location was provided.""" 1076N/A return _(
"'%s' is not a valid boot environment name.") % \
1076N/A """Used to indicate that there is an existing boot environment 1076N/A return _(
"The boot environment '%s' already exists.") % \
884N/ABoot environment naming during package install is not supported on this 884N/Aversion of OpenSolaris. Please image-update without the --be-name option.""")
884N/A return _(
"Unable to clone the current boot environment.")
884N/AA problem occurred while attempting to rename the boot environment 884N/Acurrently named %(orig)s to %(dest)s.""") % d
884N/A return _(
"Unable to mount %(name)s at %(mt)s") % \
884N/ANaming a boot environment when operating on a non-live image is 917N/A s = _(
"Info does not recognize the following options:")
941N/A """This is used when the index hash value doesn't match the hash of the 941N/A packages installed in the image.""" 926N/A """Base exception class for all publisher exceptions.""" 1087N/A """Used to indicate an operation on the publisher's meta_root failed 1087N/A because the meta_root is invalid.""" 1087N/A return _(
"Publisher meta_root '%(root)s' is invalid; unable " 926N/A """Used to indicate that a publisher name is not valid.""" 926N/A """Used to indicate that the specified repository attribute value is 926N/A return _(
"'%(value)s' is not a valid value for repository " 926N/A "attribute '%(attribute)s'.") % {
926N/A """Used to indicate that the specified repository collection type is 926N/A return _(
"'%s' is not a valid repository collection type.") % \
926N/A """Used to indicate that a repository URI is not syntactically valid.""" 926N/A """Used to indicate that the priority specified for a repository URI is 926N/A return _(
"'%s' is not a valid URI priority; integer value " 926N/A """Used to indicate that the specified repository URI sort policy is 926N/A return _(
"'%s' is not a valid repository URI sort policy.") % \
926N/A """Used to indicate that an attempt to use a disabled publisher occurred 926N/A during an operation.""" 926N/A return _(
"Publisher '%s' is disabled and cannot be used for " 926N/A """Used to indicate that a publisher with the same name or alias already 926N/A exists for an image.""" 926N/A return _(
"A publisher with the same name or alias as '%s' " 926N/A """Used to indicate that a repository with the same origin uris 926N/A already exists for a publisher.""" 926N/A return _(
"A repository with the same name or origin URIs " 926N/A """Used to indicate that a repository URI is already in use by another 926N/A return _(
"Mirror '%s' already exists for the specified " 926N/A """Used to indicate that a repository URI is already in use by another 926N/A return _(
"Origin '%s' already exists for the specified " 926N/A """Used to indicate an attempt to remove the preferred publisher was 926N/A return _(
"The preferred publisher cannot be removed.")
926N/A """Used to indicate that an attempt to remove the selected repository 926N/A for a publisher was made.""" 926N/A return _(
"Cannot remove the selected repository for a " 926N/A """Used to indicate an attempt to set a disabled publisher as the 926N/A preferred publisher was made.""" 996N/A return _(
"Publisher '%s' is disabled and cannot be set as the " 1256N/A """Used to indicate that an attempt was made to set the preferred 1256N/A return _(
"The preferred publisher may not be disabled." 1256N/A " Another publisher must be set as the preferred " 1256N/A "publisher before this publisher can be disabled.")
926N/A """Used to indicate that no matching legal URI could be found using the 926N/A """Used to indicate that no matching publisher could be found using the 926N/A """Used to indicate that no matching related URI could be found using 926N/A the provided criteria.""" 926N/A """Used to indicate that no matching repository could be found using the 926N/A """Used to indicate that a repository URI could not be found in the 926N/A list of repository mirrors.""" 926N/A """Used to indicate that a repository URI could not be found in the 926N/A list of repository origins.""" 926N/A """Used to indicate that the specified repository URI uses an 926N/A return _(
"The URI '%(uri)s' contains an unsupported " 926N/A return _(
"The specified URI contains an unsupported scheme.")
926N/A """Used to indicate that the specified repository URI attribute is not 926N/A supported for the URI's scheme.""" 926N/A return _(
"'%(attr)s' is not supported for '%(scheme)s'.") % {
926N/A """Base exception class for all certificate exceptions.""" 926N/A """Used to indicate that a certificate has expired.""" 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s' needed to access '%(uri)s', " 926N/A "has expired. Please install a valid " 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s', has expired. Please install a valid " 926N/A return _(
"Certificate '%(cert)s', needed to access " 926N/A "'%(uri)s', has expired. Please install a valid " 926N/A return _(
"Certificate '%s' has expired. Please install a " 926N/A """Used to indicate that a certificate has expired.""" 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s', needed to access '%(uri)s', " 926N/A "will expire in '%(days)s' days.") % {
926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s' will expire in '%(days)s' days.") % {
926N/A return _(
"Certificate '%(cert)s', needed to access " 926N/A "'%(uri)s', will expire in '%(days)s' days.") % {
926N/A return _(
"Certificate '%(cert)s' will expire in " 926N/A """Used to indicate that a certificate is invalid.""" 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s', needed to access '%(uri)s', is " 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A return _(
"Certificate '%(cert)s' needed to access " 1254N/A """Used to indicate that a key could not be found.""" 1254N/A return _(
"Unable to locate key '%(key)s' for " 1254N/A "publisher '%(pub)s' needed to access " 1254N/A return _(
"Unable to locate key '%(key)s' for publisher " 1254N/A return _(
"Unable to locate key '%(key)s' needed to " 926N/A """Used to indicate that a certificate could not be found.""" 926N/A return _(
"Unable to locate certificate " 926N/A "'%(cert)s' for publisher '%(pub)s' needed " 926N/A "to access '%(uri)s'.") % {
926N/A return _(
"Unable to locate certificate '%(cert)s' for " 926N/A return _(
"Unable to locate certificate '%(cert)s' " 926N/A "needed to access '%(uri)s'.") % {
926N/A """Used to indicate that a certificate is not yet valid (future 926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s', needed to access '%(uri)s', " 926N/A "has a future effective date.") % {
926N/A return _(
"Certificate '%(cert)s' for publisher " 926N/A "'%(pub)s' has a future effective date.") % {
926N/A return _(
"Certificate '%(cert)s' needed to access " 926N/A "'%(uri)s' has a future effective date.") % {
926N/A return _(
"Certificate '%s' has a future effective date.") % \
1100N/A """This exception is used when the server reutrns a line which the 1100N/A client cannot parse correctly.""" 1337N/A """This exception is used when a file was given as an argument but 1337N/A no such file could be found.""" 1352N/A """Base exception class for all manifest exceptions.""" 1352N/A """Used to indicate that the Manifest signatures are not valid.""" 1352N/A return _(
"The signature data for the manifest of the " 1352N/A return _(
"The signature data for the manifest is not valid.")
1370N/A return _(
"there is already an image at: %s.\nTo override, use " 1370N/A return _(
"the specified image path is not empty: %s.\nTo "