api_errors.py revision 1053
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""" 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" 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")
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. 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.""" 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.""" 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 " \
941N/A """This is used when the main dictionary could not parse a line.""" 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 " 926N/A """Base exception class for all transfer exceptions.""" 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.""" 884N/A return _(
"'%s' is not a valid boot envirnment name." %
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 s = _(
"Some servers failed to respond appropriately:\n")
1051N/A # The messages and structure for these error 1051N/A s += _(
" %(o)s: %(msg)s (%(code)d)\n") % \
1051N/A s += _(
" %s: timeout\n") % \
1051N/A s += _(
" %(o)s: %(other)s\n") % \
1051N/A s += _(
" %(o)s: Unable to read status of " 1051N/A "HTTP response:%(l)s\n This is " 1051N/A "most likely not a pkg(5) depot. Please " 1051N/A "check the URL and the \n port " 1051N/A s += _(
" %s: Incomplete read from " 1051N/A s += _(
" %(o)s: %(msg)s\n") % \
1051N/A s += _(
" %s: Socket timeout") %
pub[
"origin"]
1051N/A s += _(
" %(o)s: Socket error, reason: " 1051N/A s += _(
" %(o)s: %(msg)s") % \
941N/A s += _(
"%s appears not to be a valid package depot.\n" \
941N/A """This is used when the index hash value doesn't match the hash of the 941N/A packages installed in the image.""" 941N/A """This is used when the existing index is found to have inconsistent 941N/A return _(
"Search capabilities and performance are degraded.\n" 941N/A "To improve, run 'pkg rebuild-index'.")
926N/A """Base exception class for all publisher exceptions.""" 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 " 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 " 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.") % \