api_errors.py revision 2400
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] 1895N/A# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved. 838N/A# EmptyI for argument defaults; can't import from misc due to circular 1968N/A # To workaround python issues 6108 and 2517, this provides a 1540N/A # a standard wrapper for this class' exceptions so that they 2034N/A # have a chance of being stringified correctly. 1710N/AThe pkg client api module can not be invoked from an setuid executable.""")
1710N/A "unexpected exit code of %(rv)d:\n%(cmd)s") % \
1710N/A """Used to indicate that the image is currently locked by another thread 1710N/A or process and cannot be modified.""" 565N/A return _(
"The image cannot be modified as it is " 565N/A "currently in use by another package client: " 565N/A "%(pid_name)s on %(host)s, pid %(pid)s.") % {
2158N/A return _(
"The image cannot be modified as it is " 2158N/A "currently in use by another package client: " 2158N/A "%(pid_name)s on an unknown host, pid %(pid)s.") % {
2158N/A return _(
"The image cannot be modified as it is " 2158N/A "currently in use by another package client: " 2158N/A "pid %(pid)s on %(host)s.") % {
2158N/A return _(
"The image cannot be modified as it is currently " 2158N/A "in use by another package client.")
2158N/A """Used when an image was not found""" 2144N/A """Used to indicate that an image was found at a location other than 2144N/A '/' on the Solaris platform when requesting automatic image location 2144N/A discovery. Clients should trap this exception and add their own 2144N/A messaging telling the user how to specify an image root explicitly 565N/A return _(
"pkg(5) image found at '%(found)s' instead of " 565N/A """Used to indicate that an image cannot be used until its format is 1618N/A return _(
"The image rooted at %s is written in an older format " 1618N/A "and must be updated before the requested operation can be " 1618N/A """Base exception class for plan preparation errors.""" 1618N/A """Used to indicate that the requested operation could not be completed 1618N/A as one or more packages contained invalid metadata.""" 1618N/A """'errors' should be a list of exceptions or strings 1618N/A indicating what packages had errors and why.""" 1618N/A return _(
"The requested operation cannot be completed due " 1618N/A "to invalid package metadata. Details follow:\n\n" 1618N/A """Used to indicate that license-related errors occurred during 1618N/A plan evaluation or execution.""" 1618N/A """Used to indicate that plan evaluation or execution failed due 1618N/A to license-related errors for a package.""" 1618N/A """'errors' should be a list of LicenseAcceptanceError 1618N/A """A list of LicenseAcceptanceError exceptions.""" 1618N/A """Used to indicate that image plan evaluation or execution failed due 1618N/A to license-related errors.""" 1618N/A """'errors' should be a list of PkgLicenseErrors exceptions.""" 1618N/A """Returns a dictionary indexed by package FMRI string of 1618N/A lists of LicenseAcceptanceError exceptions.""" 1019N/A """Returns a string representation of the license errors.""" 1369N/A """Used to indicate that the image plan is no longer valid, likely as a 565N/A result of an image state change since the plan was created.""" 565N/A return _(
"The plan for the current operation is no longer " 565N/A "valid. The image has likely been modified by another " 565N/A "process or client. Please try the operation again.")
565N/A return _(
"Invalid package state change attempted '%(states)s' " 1335N/A return _(
"Could not operate on %s\nbecause of " 1945N/A "insufficient permissions. Please try the " 1335N/A "command again as a privileged user.") % \
1335N/ACould not complete the operation because of insufficient permissions. 1335N/APlease try the command again as a privileged user. 565N/A return _(
"Could not operate on %s\nbecause the file is " 1141N/A "in use. Please stop using the file and try the\n" 565N/A """Used to indicate that the operation was attempted on a 1505N/A return _(
"Could not complete the operation on %s: " 1505N/A return _(
"Could not complete the operation: read-only " 1505N/A s = _(
"The following pattern(s) did not match any " 922N/A s = _(
"'%s' matches multiple packages")
1505N/A s = _(
"'%s' is an illegal FMRI")
838N/A s = _(
"The following different patterns specify the " 1859N/AThe following pattern(s) did not match any allowable packages. Try 1050N/Ausing a different matching pattern, or refreshing the image: 1859N/AThe following pattern(s) only matched packages that are not available 1050N/Afor the current image's architecture, zone type, and/or other variant:""")
1859N/A s = _(
"The following patterns only matched packages " 1859N/A "that are from publishers other than that which " 1859N/A "supplied the already installed version of this package")
1050N/A s = _(
"'%s' matches multiple packages")
1859N/A s = _(
"'%s' matches no installed packages")
1859N/A s = _(
"'%s' is an illegal fmri")
1859N/A s = _(
"'%s' supports the following architectures: %s")
1050N/A a = _(
"Image architecture is defined as: %s")
2073N/A s = _(
"'%(p)s' depends on obsolete package '%(op)s'")
1859N/A s = _(
"The proposed operation can not be performed for " 1050N/A "the following package(s) as they are already " 1603N/A s = _(
"The following different patterns specify the " 1352N/A res += [_(
"No solution was found to satisfy constraints")]
1352N/ASyncing this linked image would require the following package updates: 1352N/A res += [
"%(oldfmri)s -> %(newfmri)s\n" % \
1352N/AThe proposed operation on this parent image can not be performed because 1352N/Atemporary origins were specified and this image has children. Please either 1352N/Aretry the operation again without specifying any temporary origins, or if 1352N/Apackages from additional origins are required, please configure those origins 1352N/A res += [_(
"Package %(pkg)s is missing a dependency: " 1352N/A res += [_(
"The following files are not packaged in this image:")]
1352N/A res += [_(
"The following packages are already " 1352N/A "installed in this image; use uninstall to " 1516N/A res += [_(
"The following packages are a target " 1352N/A "of group dependencies; use install to unavoid " 1352N/A s =
" %s %d: %s" % (_(
"PUBLISHER"), i,
pub)
1352N/AInvalid child image publisher configuration. Child image publisher 1352N/Aconfiguration must be a superset of the parent image publisher configuration. 1352N/APlease update the child publisher configuration to match the parent. If the 1352N/Achild image is a zone this can be done automatically by detaching and 1352N/AThe parent image has the following enabled publishers:"""))
1352N/AThe child image has the following enabled publishers:"""))
1352N/A """Used to indicate that the imageplan would result in one or more sets 1352N/A of conflicting actions, meaning that more than one action would exist on 1352N/A the system with the same key attribute value in the same namespace. 1352N/A There are three categories, each with its own subclass: 1352N/A - multiple files delivered to the same path or drivers, users, groups, 1352N/A etc, delivered with the same key attribute; 1352N/A - multiple objects delivered to the same path which aren't the same 1352N/A - multiple directories, links, or hardlinks delivered to the same path 1352N/A but with conflicting attributes. 2022N/A """A container for multiple ConflictingActionError exception objects 2022N/A that can be raised as a single exception.""" 2022N/A """Multiple actions of the same type have been delivered with the same 2022N/A key attribute (when not allowed).""" 1352N/A s = _(
"The following packages all deliver %(action)s " 1352N/A s += _(
"\n\nThese packages may not be installed together. " 1352N/A "Any non-conflicting set may\nbe, or the packages " 1352N/A "must be corrected before they can be installed.")
1352N/A s = _(
"The package %(pfmri)s delivers multiple copies " 1352N/A s += _(
"\nThis package must be corrected before it " 1352N/A """Multiple actions of different types have been delivered with the same 1352N/A 'path' attribute. While this exception could represent other action 1352N/A groups which share a single namespace, none such exist.""" 1352N/A s = _(
"The following packages deliver conflicting " 1352N/A s += _(
"\n\nThese packages may not be installed together. " 1352N/A "Any non-conflicting set may\nbe, or the packages " 1352N/A "must be corrected before they can be installed.")
1352N/A s = _(
"The package %(pfmri)s delivers conflicting " 1352N/A s += _(
"\nThis package must be corrected before it " 1352N/A """Multiple actions of the same type representing the same object have 1945N/A have been delivered, but with conflicting attributes, such as two 565N/A directories at /usr with groups 'root' and 'sys', or two 'root' users 596N/A with uids '0' and '7'.""" 614N/A # Trim the action's attributes to only those required to be 1191N/A s = _(
"The requested change to the system attempts to install " 1191N/A "multiple actions\nfor %(a)s '%(k)s' with conflicting " 1191N/A t = _(
" %(n)d package delivers '%(a)s':\n")
1191N/A t = _(
" %(n)d packages deliver '%(a)s':\n")
1191N/A t = _(
" %d packages deliver '%s', including:\n")
1191N/A s += _(
"\nThis package must be corrected before it " 1191N/A s += _(
"\nThese packages may not be installed together." 1191N/A " Any non-conflicting set may\nbe, or the packages " 1191N/A "must be corrected before they can be installed.")
1191N/A """Takes a list of items and puts them into a string, with commas in 1191N/A between items, and an "and" between the last two items. Special cases 1191N/A for lists of two or fewer items, and uses the Oxford comma.""" 1191N/A # Used for a two-element list 1191N/A return _(
"%(penultimate)s and %(ultimate)s") % {
1191N/A # In order to properly i18n this construct, we create two templates: 1191N/A # one for each element save the last, and one that tacks on the last 1191N/A # 'elementtemplate' is for each element through the penultimate 1191N/A # 'listtemplate' concatenates the concatenation of non-ultimate elements 1191N/A # and the ultimate element. 1191N/A """Used to indicate that action execution (such as install, remove, 1191N/A etc.) failed even though the action is valid. 1191N/A In particular, this exception indicates that something went wrong in the 1191N/A application (or unapplication) of the action to the system, and is most 1191N/A likely not an error in the pkg(5) code.""" 1191N/A """'action' is the object for the action that failed during the 1895N/A 'details' is an optional message explaining what operation 1191N/A failed, why it failed, and why it cannot continue. It should 1895N/A also include a suggestion as to how to resolve the situation 1191N/A 'error' is an optional exception object that may have been 1191N/A raised when the operation failed. 1191N/A 'fmri' is an optional package FMRI indicating what package 1945N/A was being operated on at the time the error occurred. 1191N/A 'use_errno' is an optional boolean value indicating whether 1191N/A the strerror() text of the exception should be used. If 1191N/A 'details' is provided, the default value is False, otherwise 1027N/A # If details were provided, don't use errno unless 565N/A # explicitly requested. 1191N/A # Fall back on the wrapped exception if we don't have anything 2028N/A "%(action)s:\n%(details)s") % {
565N/A # If we only have one of the two, no need for the colon. 1286N/A """Base exception class for all catalog exceptions.""" 2089N/A """Used to indicate that the specified FMRI is not valid for catalog 1286N/A operations because it is missing publisher information.""" 1191N/A return _(
"The FMRI '%s' does not contain publisher information " 941N/A """Used to indicate an operation on the catalog's meta_root failed 941N/A because the meta_root is invalid.""" 1191N/A return _(
"Catalog meta_root '%(root)s' is invalid; unable " 1191N/A """Used to indicate the server catalog files do not have the expected 941N/A """files should contain a list object with each entry consisting 1027N/A of a tuple of filename, expected_mode, received_mode.""" 565N/A msg = _(
"The following catalog files have incorrect " 565N/A msg += _(
"\t%(fname)s: expected mode: %(emode)s, found " 835N/A """Used to indicate that the Catalog signatures are not valid.""" 835N/A return _(
"The signature data for the '%s' catalog file is not " 835N/A """Used to indicate that the requested catalog updates could not be 835N/A applied as the new catalog data is significantly different such that 1895N/A the old catalog cannot be updated to match it.""" 835N/A return _(
"Unable to determine the updates needed for " 835N/A "the current catalog using the provided catalog " 926N/A """Used to indicate that the specified catalog operation could not be 926N/A performed since it would result in a duplicate catalog entry.""" 926N/A return _(
"Unable to perform '%(op)s' operation for catalog " 926N/A "%(name)s; completion would result in a duplicate entry " 926N/A """Used to indicate that an update request for the catalog could not 926N/A be performed because update requirements were not satisfied.""" 926N/A return _(
"Catalog updates can only be applied to an on-disk " 1736N/A """Used to indicate a Catalog file could not be loaded.""" 926N/A """Used to indicate that a Catalog's attributes and parts do not 926N/A match. This is likely the result of an attributes file being 926N/A retrieved which doesn't match the parts that were retrieved such 926N/A as in a misconfigured or stale cache case.""" 1191N/A return _(
"The content of the catalog for publisher '%s' " 1191N/A "doesn't match the catalog's attributes. This is " 1191N/A "likely the result of a mix of older and newer " 1191N/A "catalog files being provided for the publisher.") % \
926N/A """Used to indicate that the specified catalog updates are for an older 926N/A version of the catalog and cannot be applied.""" 926N/A return _(
"Unable to determine the updates needed for the " 926N/A "catalog using the provided catalog update data in '%s'. " 1191N/A "The specified catalog updates are for an older version " 926N/A """Used to indicate that an entry for the specified package FMRI or 1191N/A pattern could not be found in the catalog.""" 926N/A return _(
"'%s' could not be found in the catalog.") %
self.
data 1191N/A """Used to indicate that the specified CatalogUpdate operation is 926N/A """Raised when the catalog finds a CatalogPart that is unrecognized 941N/A return _(
"Unrecognized, unknown, or invalid CatalogPart '%s'") \
884N/A """Used to indicate that some of the specified patterns to a catalog 884N/A matching function did not match any catalog entries, or were invalid 884N/A # Illegal FMRIs have their own __str__ method 884N/A outstr += _(
"No matching package could be found for " 884N/A "the following FMRIs in any of the catalogs for " 884N/A "the current publishers:\n")
884N/A """Based class used for all search-related api exceptions.""" 884N/A """Raised when the server cannot understand the format of the 884N/A """Returned when the search cannot find any matches.""" 917N/A return _(
"The search at url %s returned no results.") %
self.
url 917N/A """This class wraps exceptions which could appear while trying to 917N/A do a search request.""" 941N/A s = _(
"Some repositories failed to respond appropriately:\n")
941N/A s += _(
"%(o)s:\n%(msg)s\n") % \
926N/A s += _(
"%s did not return a valid response.\n" \
926N/A s += _(
"Some repositories don't support requested " 926N/A s += _(
"%(o)s:\n%(msg)s\n") % \
1087N/A """This exception is thrown when a local search is performed without 1087N/A an index. It's raised after all results have been yielded.""" 1087N/A return _(
"Search performance is degraded.\n" 1087N/A "Run 'pkg rebuild-index' to improve search speed.")
1087N/A """Returned when a search protocol is not supported by the 926N/A s = _(
"Search repository does not support the requested " 926N/A """ The base class for all exceptions that can occur while indexing. """ 926N/A """This is used when the index is not in a correct state.""" 926N/A """This is used when the existing index is found to have inconsistent 926N/A """This is used when an attempt to modify an index locked by another 926N/A process or thread is made.""" 926N/A """ This is used when the indexer is unable to create, move, or remove 926N/A files or directories it should be able to. """ 926N/A return "Could not remove or create " \
926N/A "%s because of incorrect " \
926N/A "permissions. Please correct this issue then " \
926N/A """This exception is used to wrap an indexing exception during install, 926N/A uninstall, or update so that a more appropriate error message can be 926N/A displayed to the user.""" 926N/A """This exception is used to wrap an indexing exception during install, 926N/A uninstall, or update which was recovered from by performing a full 926N/A# Query Parsing Exceptions 926N/A """This exception is used when the children of a boolean operation 926N/A have different return types. The command 'pkg search foo AND <bar>' 926N/A is the simplest example of this.""" 926N/A """Removal of a package which satisfies dependencies has been attempted. 926N/A The first argument to the constructor is the FMRI which we tried to 926N/A remove, and is available as the "fmri" member of the exception. The 926N/A second argument is the list of dependent packages that prevent the 926N/A removal of the package, and is available as the "dependents" member. 926N/A s = _(
"\nThis is happening because the following " 926N/A "packages needed to be repaired as\npart of this " 926N/A s += _(
"\n\nYou will need to reestablish your access to the " 926N/A "repository or remove the\npackages in the list above.")
926N/A """Raised when the depot doesn't have versions of operations 996N/A that the client needs to operate successfully.""" 1256N/A s = _(
"Unable to contact valid package repository")
1256N/A s += (
"\nEncountered the following error(s):\n%s") % \
926N/A """Base exception class used for all data related errors.""" 1736N/A """Used to indicate that the specified location does not contain a 1736N/A valid p5i-formatted file.""" 1736N/A return _(
"The provided p5i data is in an unrecognized " 1736N/A "format or does not contain valid publisher " 1736N/A return _(
"The provided p5i data is in an unrecognized format " 1736N/A "or does not contain valid publisher information.")
1736N/A """Used to indicate that the specified location does not contain a 1736N/A valid p5i-formatted file.""" 1736N/A return _(
"The provided p5s data is in an unrecognized " 1736N/A "format or does not contain valid publisher " 1736N/A return _(
"The provided p5s data is in an unrecognized format " 1736N/A "or does not contain valid publisher information.")
1736N/A """Used to indicate that an attempt to read an unsupported version 1736N/A of pkg(5) info file was attempted.""" 1736N/A return _(
"Unsupported pkg(5) publisher information data " 1736N/A """Used to indicate that an attempt to read an unsupported version 1736N/A of pkg(5) info file was attempted.""" 926N/A return _(
"Unsupported pkg(5) publisher and image 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 _(
"%s is not a supported version for creating a " 926N/A """Abstract exception class for all transport exceptions. 926N/A Specific transport exceptions should be implemented in the 926N/A transport code. Callers wishing to catch transport exceptions 926N/A should use this class. Subclasses must implement all methods 926N/A defined here that raise NotImplementedError.""" 1431N/A """Used to indicate that a a requested resource could not be 1736N/A return _(
"Error encountered while retrieving data from " 1736N/A return _(
"Error encountered while retrieving data from: %s") % \
1736N/A """Used to indicate that an invalid transport location was provided.""" 926N/A return _(
"'%s' is not a valid boot environment name.") % \
926N/A """Used to indicate that there is an existing boot environment 2144N/A return _(
"The boot environment '%s' already exists.") % \
926N/ABoot environment naming during package install is not supported on this 926N/Aversion of OpenSolaris. Please update without the --be-name option.""")
926N/A return _(
"Unable to clone the current boot environment.")
2026N/AA problem occurred while attempting to rename the boot environment 2026N/Acurrently named %(orig)s to %(dest)s.""") % d
2026N/A return _(
"Unable to mount %(name)s at %(mt)s") % \
2026N/ANaming a boot environment when operating on a non-live image is 2026N/A s = _(
"Info does not recognize the following options:")
2026N/A """This is used when the index hash value doesn't match the hash of the 2026N/A packages installed in the image.""" 2026N/A """Base exception class for all publisher exceptions.""" 2026N/A """Used to indicate an operation on the publisher's meta_root failed 2026N/A because the meta_root is invalid.""" 2026N/A return _(
"Publisher meta_root '%(root)s' is invalid; unable " 2026N/A """Used to indicate that a publisher alias is not valid.""" 2026N/A """Used to indicate that a publisher name is not valid.""" 2026N/A """Used to indicate that a publisher name is not valid.""" 2026N/A return _(
"'%(pkg_pub)s' is a reserved publisher and does not " 2026N/A "contain the requested package: pkg:/%(pkg_name)s") % \
2026N/A """Used to indicate that the specified repository attribute value is 2026N/A return _(
"'%(value)s' is not a valid value for repository " 2026N/A "attribute '%(attribute)s'.") % {
2026N/A """Used to indicate that the specified repository collection type is 2026N/A return _(
"'%s' is not a valid repository collection type.") % \
2026N/A """Used to indicate that a repository URI is not syntactically valid.""" 2026N/A """Used to indicate that the priority specified for a repository URI is 2026N/A return _(
"'%s' is not a valid URI priority; integer value " 2026N/A """Used to indicate that the specified repository URI sort policy is 2026N/A return _(
"'%s' is not a valid repository URI sort policy.") % \
2026N/A """Used to indicate that an attempt to use a disabled publisher occurred 2026N/A return _(
"Publisher '%s' is disabled and cannot be used for " 2026N/A """Used to indicate that a publisher with the same name or alias already 2026N/A return _(
"A publisher with the same name or alias as '%s' " 2026N/A """Used to indicate that a repository with the same origin uris 2026N/A already exists for a publisher.""" 2026N/A return _(
"A repository with the same name or origin URIs " 2026N/A """Used to indicate that a repository URI is already in use by another 2026N/A return _(
"Mirror '%s' already exists for the specified " 2026N/A """Used to indicate that a repository URI is already in use by another 2026N/A return _(
"Origin '%s' already exists for the specified " 2026N/A """Used to indicate that a Publisher has no repository information 2026N/A configured and so transport operations cannot be performed.""" 926N/A return _(
"Unable to retrieve requested package data for " 926N/A "publisher %s; no repositories are currently configured " 926N/A """Used to indicate an attempt to search a repo before or after itself""" 1516N/A return _(
"Cannot search a repository before or after itself")
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 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 one or more publisher prefixes are unknown by 926N/A the specified repository.""" 926N/A return _(
"The repository at %(location)s does not " 926N/A "contain package data for %(unknown)s; only " 926N/A "%(known)s.\n\nThis is either because the " 926N/A "repository location is not valid, or because the " 926N/A "provided publisher does not match those known by " 926N/A return _(
"One or more of the repository origin(s) " 926N/A "listed below contains package data for " 926N/A "%(known)s; not %(unknown)s:\n\n%(origins)s\n\n" 926N/A "This is either because one of the repository " 926N/A "origins is not valid for this publisher, or " 926N/A "because the list of known publishers retrieved " 926N/A "from the repository origin does not match the " 926N/A return _(
"The specified publisher repository does not " 926N/A "contain any package data for %(unknown)s; only " 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 1254N/A """Used to indicate that a repository URI could not be found in the 1254N/A list of repository mirrors.""" 1254N/A """The publisher has no active repositories that support the 926N/A return _(
"Publisher '%(pub)s' has no repositories that support " 926N/A """Used to indicate that the specified repository does not provide 926N/A publisher configuration information.""" 926N/A return _(
"The specified package repository does not " 926N/A "provide publisher configuration information.")
926N/A return _(
"The package repository at %s does not " 926N/A "provide publisher configuration information or " 926N/A "the information provided is incomplete.") % \
926N/A return _(
"One of the package repository origins for %s does " 926N/A "not provide publisher configuration information or the " 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 941N/A return _(
"The URI '%(uri)s' uses the unsupported " 941N/A "scheme '%(scheme)s'. Supported schemes are " 941N/A "file://, http://, and https://.") % {
1100N/A return _(
"The specified URI uses an unsupported scheme." 1100N/A " Supported schemes are: file://, http://, and https://.")
941N/A """Used to indicate that the specified repository URI attribute is not 941N/A supported for the URI's scheme.""" 1352N/A return _(
"'%(attr)s' is not supported for '%(scheme)s'.") % {
1337N/A """Used when a pkg client needs to communicate with the system 1337N/A repository but can't find the configuration for it.""" 1352N/Apkg is configured to use the system repository (via the use-system-repo 1352N/Aproperty) but it could not get the host and port from 1352N/Athe PKG_SYSREPO_URL environment variable was not set. Please try enabling one 1352N/Aof those services or setting the PKG_SYSREPO_URL environment variable. 1352N/A """This exception is raised when a user attempts to modify a system 1352N/A """The base class for exceptions related to manifest signing.""" 1736N/A # This string method is used by subclasses to fill in the details 1736N/A # about the package and signature involved. 1736N/A return _(
"The relevant signature action is " 1736N/A "found in %(pfmri)s and has a hash of " 1736N/A return _(
"The relevant signature action's value " 1370N/A """Exception used when a key, certificate or CRL file is not in a 1370N/A """Exception used when a signature reports a version which this version 1370N/A of pkg(5) doesn't support.""" 2144N/A return _(
"The signature action %(act)s was made using a " 2144N/A "version (%(ver)s) this version of pkg(5) doesn't " 2144N/A """Base class for exceptions encountered while establishing the chain 2144N/A """Exception used when a certificate does not match its expected hash 2026N/A return _(
"Certificate %s has been modified on disk. Its hash " 2073N/A """Exception used when a chain of trust is rooted in an untrusted 2073N/A self-signed certificate.""" 2073N/A return _(
"Chain was rooted in an untrusted self-signed " 2026N/A """Exception used when a chain of trust can not be established between 2026N/A the leaf certificate and a trust anchor.""" s = _(
"The following problems were encountered:\n") + \
return _(
"The certificate which issued this " "certificate:%(subj)s could not be found. The issuer " """Exception used when a chain of trust contains a revoked certificate. return _(
"This certificate was revoked:%(cert)s for this " """Exception used when a signature could not be verified by the return _(
"A signature in %(pfmri)s could not be " "this reason:\n%(reason)s\nThe signature's hash is " return _(
"The signature with this signature value:\n" "%(sigval)s\n could not be verified for this reason:\n" """Exception used when signatures were required but none were found.""" return _(
"The policy for %(pub_str)s requires " "signatures to be present but no signature was " "found in %(fmri_str)s.") % \
return _(
"The policy for %(pub_str)s requires signatures to be " "present but no signature was found.") % {
"""Exception used when a signature policy required names to be seen return _(
"The policy for %(pub_str)s requires certain " "CNs to be seen in a chain of trust. The following " "required names couldn't be found for this " "package:%(fmri_str)s.\n%(missing)s") % \
return _(
"The policy for %(pub_str)s requires certain CNs to " "be seen in a chain of trust. The following required names " "couldn't be found.\n%(missing)s") % {
"pub_str":
pub_str,
"""Exception used when a certificate in the chain of trust uses a critical extension pkg5 doesn't understand.""" return _(
"The certificate whose subject is %(cert)s could not " "because it uses a critical extension that pkg5 cannot " "handle yet.\nExtension name:%(name)s\nExtension " """Exception used when a certificate in the chain of trust has an extension with a value pkg5 doesn't understand.""" s = _(
"The certificate whose subject is %(cert)s could not be " "verified because it has an extension with a value that " "pkg(5) does not understand." "\nExtension name:%(name)s\nExtension value:%(val)s") % \
"""Exception used when a certificate in the chain of trust has been used inappropriately. An example would be a certificate which was only supposed to be used to sign code being used to sign other certificates. return _(
"The certificate whose subject is %(cert)s could not " "be verified because it has been used inappropriately. " "The way it is used means that the value for extension " "%(name)s must include '%(use)s' but the value was " """Exception used when a certificate in the chain of trust has been used inappropriately. An example would be a certificate which was only supposed to be used to sign code being used to sign other certificates. return _(
"The certificate whose subject is %(cert)s could not " "be verified because it has been used inappropriately. " "There can only be %(cl)s certificates between this " "certificate and the leaf certificate. There are %(al)s " "certificates between this certificate and the leaf in " """Exception used when a package already has a signature action which is nearly identical to the one being added but differs on some s = _(
"The signature to be added to the package has the same " "hash (%(hash)s), algorithm (%(algorithm)s), and " "version (%(version)s) as an existing signature, but " "doesn't match the signature exactly. For this signature " "to be added, the existing signature must be removed.") % {
s += _(
"The package being signed was %(pkg)s") % \
"""Exception used when a package already has a signature action which is nearly identical to the one being added but differs on some return _(
"%s could not be signed because it already has two " "copies of this signature in it. One of those signature " "actions must be removed before the package is given to " """Exception used when a property was set to an invalid value.""" """Base exception class for all certificate exceptions.""" """Used to indicate that a certificate has expired.""" return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s' needed to access '%(uri)s', " "has expired. Please install a valid " return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s', has expired. Please install a valid " return _(
"Certificate '%(cert)s', needed to access " "'%(uri)s', has expired. Please install a valid " return _(
"Certificate '%s' has expired. Please install a " """Used to indicate that a certificate has expired.""" return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s', needed to access '%(uri)s', " "will expire in '%(days)s' days.") % {
return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s' will expire in '%(days)s' days.") % {
return _(
"Certificate '%(cert)s', needed to access " "'%(uri)s', will expire in '%(days)s' days.") % {
return _(
"Certificate '%(cert)s' will expire in " """Used to indicate that a certificate is invalid.""" return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s', needed to access '%(uri)s', is " return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s' is invalid.") % {
"cert":
self.
data,
return _(
"Certificate '%(cert)s' needed to access " "'%(uri)s' is invalid.") % {
"cert":
self.
data,
return _(
"Invalid certificate '%s'.") %
self.
data """Used to indicate that a key could not be found.""" return _(
"Unable to locate key '%(key)s' for " "publisher '%(pub)s' needed to access " return _(
"Unable to locate key '%(key)s' for publisher " return _(
"Unable to locate key '%(key)s' needed to " "access '%(uri)s'.") % {
"key":
self.
data,
return _(
"Unable to locate key '%s'.") %
self.
data """Used to indicate that a certificate could not be found.""" return _(
"Unable to locate certificate " "'%(cert)s' for publisher '%(pub)s' needed " "to access '%(uri)s'.") % {
return _(
"Unable to locate certificate '%(cert)s' for " "publisher '%(pub)s'.") % {
"cert":
self.
data,
return _(
"Unable to locate certificate '%(cert)s' " "needed to access '%(uri)s'.") % {
return _(
"Unable to locate certificate '%s'.") %
self.
data """Used to indicate that a certificate is not yet valid (future return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s', needed to access '%(uri)s', " "has a future effective date.") % {
return _(
"Certificate '%(cert)s' for publisher " "'%(pub)s' has a future effective date.") % {
return _(
"Certificate '%(cert)s' needed to access " "'%(uri)s' has a future effective date.") % {
return _(
"Certificate '%s' has a future effective date.") % \
"""This exception is used when the server returns a line which the client cannot parse correctly.""" return _(
"Gave a bad response:%s") %
self.
line """This exception is used when a file was given as an argument but no such file could be found.""" return _(
"Could not find %s") %
self.
path """Base exception class for all manifest exceptions.""" """Used to indicate that the Manifest signatures are not valid.""" return _(
"The signature data for the manifest of the " "'%s' package is not valid.") %
self.
data return _(
"The signature data for the manifest is not valid.")
"""Used to indicate that one or more exceptions were encountered. This is intended for use with where multiple exceptions for multiple files are encountered and the errors have been condensed into a single exception and re-raised. One example case would be rmtree() # Image creation exceptions return _(
"there is already an image at: %s.\nTo override, use " """Used to indicate that the image configuration is invalid.""" return _(
"The configuration data for the image rooted at " """Used to indicate that the image at a specific location is in a format not supported by this version of the pkg(5) API.""" return _(
"The image rooted at %s is invalid or is not " "supported by this version of the packaging system.") % \
return _(
"the specified image path is not empty: %s.\nTo " "override, use the -f (force) option.") %
self.
path """Converts the provided exception into an ApiException equivalent if possible. Returns a new exception object if converted or the original 'ignored_errors' is an optional list of errno values for which None # first deal with an error bundle # set default error return value err = _(
"Invalid linked image attach property: %s") % \
err = _(
"Invalid linked image attach property " err = _(
"Linked image type does not support child " err = _(
"Linked image type does not support parent " err = _(
"Cannot attach root image as child")
err = _(
"Can't initialize child image " "(%(lin)s) at path: %(path)s") % {
err = _(
"Can't initialize child image " err = _(
"Linked image is diverged: %s") % \
err = _(
"A linked child image with this name " err = _(
"Child image '%(cpath)s' is nested " "within another image: '%(ipath)s'") % {
err = _(
"Child image '%(path)s' is not located " "within the parent's altroot '%(altroot)s'") % {
err = _(
"Child image '%(cpath)s' is not nested " "within the parent image '%(ppath)s'") % {
err = _(
"Linked image %(op)s failed for: %(lin)s") % \
err = _(
"Can't access child image " "(%(lin)s) at path: %(path)s") % {
err = _(
"Can't access child image " err = _(
"Child path not absolute: %s") % \
err = _(
"Unknown child linked image: %s") % \
err = _(
"Linked image type does not support " err = _(
"Parent linked to child, can not detach " err = _(
"Linked image type does not support " err = _(
"Image already a linked child: %s") % \
err = _(
"Invalid linked image name: %s") % \
err = _(
"Can't link image to itself.")
err = _(
"Can't initialize parent image at path: %s") % \
err = _(
"Parent path not absolute: %s") % \
err = _(
"Can't access parent image at path: %s") % \
err = _(
"Parent image '%(path)s' is not located " "within the child's altroot '%(altroot)s'") % {
Recursive linked image operation failed for child '%(lin)s'. The following subprocess returned an unexpected exit code of %(exitrv)d: %(recursive_cmd_fail)s""" err = _(
"Current image already a linked child: %s") % \
err = _(
"Current image is not a linked child: %s") % \
# set default error return value "self.lix_err = %s, self.lix_bundle = %s" % \
# concatenate multiple errors