api_errors.py revision 1254
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] 3321N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 926N/A# Use is subject to license terms. 2524N/A# EmptyI for argument defaults; can't import from misc due to circular 926N/A """Used when an image was not found""" 2524N/A return _(
"Could not operate on %s\nbecause of " 2524N/A "insufficient permissions. Please try the command " 2524N/A "again using pfexec\nor otherwise increase your " 2524N/ACould not complete the operation because of insufficient permissions. Please 2524N/Atry the command again using pfexec or otherwise increase your privileges. 1710N/A return _(
"Could not operate on %s\nbecause the file is " 1710N/A "in use. Please stop using the file and try the\n" 1710N/AThe following pattern(s) did not match any packages in the current catalog. 1710N/ATry relaxing the pattern, refreshing and/or examining the catalogs:""")
565N/A s = _(
"'%s' matches multiple packages")
3158N/A s = _(
"'%s' matches no installed packages")
2144N/A s = _(
"'%s' is an illegal fmri")
2144N/A s = _(
"The following package(s) violated constraints:")
3158N/A s = _(
"'%s' supports the following architectures: %s")
2144N/A a = _(
"Image architecture is defined as: %s")
2407N/A """An error was encountered executing an action. 2407N/A In particular, this exception indicates that something went wrong in the 3158N/A application (or unapplication) of the action to the system, not an error 3158N/A The 'msg' argument can provide a more specific message than what would 3158N/A be returned from, and 'ignoreerrno' can be set to True to indicate that 3158N/A the sterror() text is misleading, and shouldn't be displayed. 1618N/A # Fall back on the wrapped exception if we don't have anything 1755N/A # If we only have one of the two, no need for the colon. 1755N/A """Base class used for all catalog cache errors.""" 1618N/A """Used to indicate that the catalog cache is invalid or is not of a 1618N/A return _(
"Unsupported catalog cache Version: '%(found)s'; " 1618N/A """Used to indicate that the catalog cache is corrupt or otherwise 1618N/A return _(
"Catalog cache is corrupt or invalid; error " 1618N/A "encountered while reading:\nline %(lnum)d: '%(data)s'") % {
1618N/A """Used to indicate that the catalog cache is missing.""" 1618N/A return _(
"Catalog cache is missing.")
1618N/A # Illegal FMRIs have their own __str__ method 1618N/A "the following FMRIs in any of the catalogs for " 1618N/A "the current publishers:\n")
1618N/A """Based class used for all search-related api exceptions.""" 1019N/A """This is used when the main dictionary could not parse a line.""" 565N/A """Raised when the server cannot understand the format of the 565N/A """Returned when the search cannot find any matches.""" 1710N/A return _(
"The search at url %s returned no results.") %
self.
url 1710N/A """This class wraps exceptions which could appear while trying to 1369N/A s = _(
"Some servers failed to respond appropriately:\n")
3158N/A s += _(
"%(o)s:\n%(msg)s\n") % \
1369N/A s += _(
"%s did not return a valid response.\n" \
3356N/A s += _(
"Some servers don't support requested search" 565N/A s += _(
"%(o)s:\n%(msg)s\n") % \
2976N/A """This exception is thrown when a local search is performed without 2976N/A an index. It's raised after all results have been yielded.""" 1328N/A return _(
"Search performance is degraded.\n" 565N/A "Run 'pkg rebuild-index' to improve search speed.")
565N/A """Returned when a search protocol is not supported by the 685N/A s = _(
"Search server does not support the requested protocol:")
3158N/A """ The base class for all exceptions that can occur while indexing. """ 2612N/A """This is used when the index is not in a correct state.""" 2612N/A """This is used when the existing index is found to have inconsistent 1335N/A """ This is used when the indexer is unable to create, move, or remove 3158N/A files or directories it should be able to. """ 1335N/A return "Could not remove or create " \
1335N/A "%s because of incorrect " \
1335N/A "permissions. Please correct this issue then " \
2974N/A """This exception is used when the children of a boolean operation 2974N/A have different return types. The command 'pkg search foo AND <bar>' 2974N/A is the simplest example of this.""" 2301N/A """Removal of a package which satisfies dependencies has been attempted. 2301N/A The first argument to the constructor is the FMRI which we tried to 2301N/A remove, and is available as the "fmri" member of the exception. The 2301N/A second argument is the list of dependent packages that prevent the 3158N/A removal of the package, and is available as the "dependents" member. 3158N/A """Raised when the depot doesn't have versions of operations 3158N/A that the client needs to operate successfully.""" 2301N/A s =
"Unable to contact valid package server" 2301N/A s +=
"\nEncountered the following error(s):\n%s" % \
3384N/A """Base exception class used for all data related errors.""" 3384N/A """Used to indicate that the specified location does not contain a 3384N/A valid p5i-formatted file.""" 2339N/A return _(
"The specified file is in an unrecognized " 2339N/A "format or does not contain valid publisher " 2339N/A return _(
"The specified file is in an unrecognized format or " 2453N/A "does not contain valid publisher information.")
2339N/A """Used to indicate that an attempt to read an unsupported version 2339N/A of pkg(5) info file was attempted.""" 2339N/A return _(
"Unsupported pkg(5) publisher information data " 2445N/A """Abstract exception class for all transport exceptions. 2339N/A Specific transport exceptions should be implemented in the 3110N/A transport code. Callers wishing to catch transport exceptions 2339N/A should use this class. Subclasses must implement all methods 2339N/A defined here that raise NotImplementedError.""" 2339N/A """Used to indicate that a a requested resource could not be 2339N/A return _(
"Error encountered while retrieving data from " 2339N/A return _(
"Error encountered while retrieving data from: %s") % \
2339N/A """Used to indicate that an invalid transport location was provided.""" 2445N/A return _(
"'%s' is not a valid boot environment name.") % \
2445N/A """Used to indicate that there is an existing boot environment 1505N/A return _(
"The boot environment '%s' already exists.") % \
3158N/ABoot environment naming during package install is not supported on this 922N/Aversion of OpenSolaris. Please image-update without the --be-name option.""")
3158N/A return _(
"Unable to clone the current boot environment.")
3158N/AA problem occurred while attempting to rename the boot environment 3158N/Acurrently named %(orig)s to %(dest)s.""") % d
1352N/A return _(
"Unable to mount %(name)s at %(mt)s") % \
2681N/ANaming a boot environment when operating on a non-live image is 2197N/A s = _(
"Info does not recognize the following options:")
2339N/A """This is used when the index hash value doesn't match the hash of the 2339N/A packages installed in the image.""" 1505N/A """Base exception class for all publisher exceptions.""" 3158N/A """Used to indicate an operation on the publisher's meta_root failed 3158N/A because the meta_root is invalid.""" 3158N/A return _(
"Publisher meta_root '%(root)s' is invalid; unable " 2207N/A """Used to indicate that a publisher name is not valid.""" 2228N/A """Used to indicate that the specified repository attribute value is 3158N/A return _(
"'%(value)s' is not a valid value for repository " 2228N/A "attribute '%(attribute)s'.") % {
2505N/A """Used to indicate that the specified repository collection type is 2339N/A return _(
"'%s' is not a valid repository collection type.") % \
2339N/A """Used to indicate that a repository URI is not syntactically valid.""" 2339N/A """Used to indicate that the priority specified for a repository URI is 2339N/A return _(
"'%s' is not a valid URI priority; integer value " 2339N/A """Used to indicate that the specified repository URI sort policy is 3110N/A return _(
"'%s' is not a valid repository URI sort policy.") % \
565N/A """Used to indicate that an attempt to use a disabled publisher occurred 2205N/A return _(
"Publisher '%s' is disabled and cannot be used for " 2205N/A """Used to indicate that a publisher with the same name or alias already 2205N/A return _(
"A publisher with the same name or alias as '%s' " 2205N/A """Used to indicate that a repository with the same origin uris 2205N/A already exists for a publisher.""" 2205N/A return _(
"A repository with the same name or origin URIs " 2205N/A """Used to indicate that a repository URI is already in use by another 2205N/A return _(
"Mirror '%s' already exists for the specified " 2205N/A """Used to indicate that a repository URI is already in use by another 3158N/A return _(
"Origin '%s' already exists for the specified " 3347N/A """Used to indicate an attempt to remove the preferred publisher was 3158N/A return _(
"The preferred publisher cannot be removed.")
2205N/A """Used to indicate that an attempt to remove the selected repository 2205N/A for a publisher was made.""" 2205N/A return _(
"Cannot remove the selected repository for a " 2205N/A """Used to indicate an attempt to set a disabled publisher as the 2205N/A preferred publisher was made.""" 2205N/A return _(
"Publisher '%s' is disabled and cannot be set as the " 3158N/A """Used to indicate that no matching legal URI could be found using the 2205N/A """Used to indicate that no matching publisher could be found using the 2205N/A """Used to indicate that no matching related URI could be found using 2205N/A """Used to indicate that no matching repository could be found using the 3234N/A """Used to indicate that a repository URI could not be found in the 2453N/A list of repository mirrors.""" 2205N/A """Used to indicate that a repository URI could not be found in the 2205N/A list of repository origins.""" 2205N/A """Used to indicate that the specified repository URI uses an 2205N/A return _(
"The URI '%(uri)s' contains an unsupported " 3158N/A return _(
"The specified URI contains an unsupported scheme.")
2205N/A """Used to indicate that the specified repository URI attribute is not 3158N/A supported for the URI's scheme.""" 3158N/A return _(
"'%(attr)s' is not supported for '%(scheme)s'.") % {
2239N/A """Base exception class for all certificate exceptions.""" 3206N/A """Used to indicate that a certificate has expired.""" 3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A "'%(pub)s' needed to access '%(uri)s', " 3206N/A "has expired. Please install a valid " 3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A "'%(pub)s', has expired. Please install a valid " 3206N/A return _(
"Certificate '%(cert)s', needed to access " 3206N/A "'%(uri)s', has expired. Please install a valid " 3206N/A return _(
"Certificate '%s' has expired. Please install a " 3206N/A """Used to indicate that a certificate has expired.""" 3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A "'%(pub)s', needed to access '%(uri)s', " 3206N/A "will expire in '%(days)s' days.") % {
3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A "'%(pub)s' will expire in '%(days)s' days.") % {
3206N/A return _(
"Certificate '%(cert)s', needed to access " 3206N/A "'%(uri)s', will expire in '%(days)s' days.") % {
3206N/A return _(
"Certificate '%(cert)s' will expire in " 3206N/A """Used to indicate that a certificate is invalid.""" 3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A "'%(pub)s', needed to access '%(uri)s', is " 3206N/A return _(
"Certificate '%(cert)s' for publisher " 3206N/A return _(
"Certificate '%(cert)s' needed to access " 3206N/A """Used to indicate that a key could not be found.""" 3206N/A return _(
"Unable to locate key '%(key)s' for " 3206N/A "publisher '%(pub)s' needed to access " 3206N/A return _(
"Unable to locate key '%(key)s' for publisher " 3206N/A return _(
"Unable to locate key '%(key)s' needed to " 3206N/A """Used to indicate that a certificate could not be found.""" 3206N/A return _(
"Unable to locate certificate " 3206N/A "'%(cert)s' for publisher '%(pub)s' needed " 3206N/A "to access '%(uri)s'.") % {
3206N/A return _(
"Unable to locate certificate '%(cert)s' for " 3206N/A return _(
"Unable to locate certificate '%(cert)s' " 3206N/A "needed to access '%(uri)s'.") % {
3206N/A """Used to indicate that a certificate is not yet valid (future 2205N/A return _(
"Certificate '%(cert)s' for publisher " 2205N/A "'%(pub)s', needed to access '%(uri)s', " 2205N/A "has a future effective date.") % {
3158N/A return _(
"Certificate '%(cert)s' for publisher " 3158N/A "'%(pub)s' has a future effective date.") % {
2205N/A return _(
"Certificate '%(cert)s' needed to access " 2205N/A "'%(uri)s' has a future effective date.") % {
3158N/A return _(
"Certificate '%s' has a future effective date.") % \
3158N/A """This exception is used when the server reutrns a line which the 3158N/A client cannot parse correctly."""