api_errors.py revision 2614
3261N/A# The contents of this file are subject to the terms of the 3261N/A# Common Development and Distribution License (the "License"). 3261N/A# You may not use this file except in compliance with the License. 3261N/A# See the License for the specific language governing permissions 3261N/A# and limitations under the License. 3261N/A# When distributing Covered Code, include this CDDL HEADER in each 3261N/A# If applicable, add the following below this CDDL HEADER, with the 3261N/A# fields enclosed by brackets "[]" replaced with your own identifying 3261N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3261N/A# Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 691N/A# EmptyI for argument defaults; can't import from misc due to circular 3261N/A # To workaround python issues 6108 and 2517, this provides a 3261N/A # a standard wrapper for this class' exceptions so that they 3261N/A # have a chance of being stringified correctly. 3261N/AThe pkg client api module can not be invoked from an setuid executable.""")
3261N/A """Private base exception class for all History exceptions.""" 3261N/A """Used to indicate that an unexpected error occurred while loading 3261N/A History operation information. 3261N/A The first argument should be an exception object related to the """Used to indicate that invalid time / range values were provided to history API functions.""" """Used to indicate that an unexpected error occurred while storing History operation information. The first argument should be an exception object related to the """Used to indicate that an unexpected error occurred while purging History operation information. The first argument should be an exception object related to the """Used to indicate that the image is currently locked by another thread or process and cannot be modified.""" return _(
"The image cannot be modified as it is " "currently in use by another package client: " "%(pid_name)s on %(host)s, pid %(pid)s.") % {
return _(
"The image cannot be modified as it is " "currently in use by another package client: " "%(pid_name)s on an unknown host, pid %(pid)s.") % {
return _(
"The image cannot be modified as it is " "currently in use by another package client: " "pid %(pid)s on %(host)s.") % {
return _(
"The image cannot be modified as it is currently " "in use by another package client.")
"""Used when an image was not found""" """Used to indicate that an image cannot be used until its format is return _(
"The image rooted at %s is written in an older format " "and must be updated before the requested operation can be " """Used when insuffcient space exists for proposed operation""" return _(
"Insufficent disk space available (%(avail)s)" "for estimated need (%(needed)s) for %(use)s") % {
"""Base exception class for plan preparation errors.""" """Used to indicate that the requested operation could not be completed as one or more packages contained invalid metadata.""" """'errors' should be a list of exceptions or strings indicating what packages had errors and why.""" return _(
"The requested operation cannot be completed due " "to invalid package metadata. Details follow:\n\n" """Used to indicate that license-related errors occurred during plan evaluation or execution.""" """Used to indicate that plan evaluation or execution failed due to license-related errors for a package.""" """'errors' should be a list of LicenseAcceptanceError """A list of LicenseAcceptanceError exceptions.""" """Used to indicate that image plan evaluation or execution failed due to license-related errors.""" """'errors' should be a list of PkgLicenseErrors exceptions.""" """Returns a dictionary indexed by package FMRI string of lists of LicenseAcceptanceError exceptions.""" """Returns a string representation of the license errors.""" output += _(
" License requires " output += _(
" License must be viewed.")
"""Used to indicate that the image plan is no longer valid, likely as a result of an image state change since the plan was created.""" return _(
"The plan for the current operation is no longer " "valid. The image has likely been modified by another " "process or client. Please try the operation again.")
return _(
"Invalid package state change attempted '%(states)s' " "for package '%(fmri)s'.") % {
"states":
self.
states,
return _(
"Could not operate on %s\nbecause of " "insufficient permissions. Please try the " "command again as a privileged user.") % \
Could not complete the operation because of insufficient permissions. Please try the command again as a privileged user. return _(
"Could not operate on %s\nbecause the file is " "in use. Please stop using the file and try the\n" return _(
"Insufficient access to complete the requested " "operation.\nPlease try the operation again as a " """Used to indicate that the operation was attempted on a return _(
"Could not complete the operation on %s: " return _(
"Could not complete the operation: read-only " """Used to indicate which patterns were not matched or illegal during a package name matching operation.""" s = _(
"The following pattern(s) did not match any " s = _(
"'%s' matches multiple packages")
s = _(
"'%s' is an illegal FMRI")
s = _(
"The following different patterns specify the "The following pattern(s) did not match any allowable packages. Try using a different matching pattern, or refreshing publisher information: The following pattern(s) only matched packages rejected by user request. Try using a different matching pattern, or refreshing publisher information: The following pattern(s) only matched packages that are not available for the current image's architecture, zone type, and/or other variant:""")
s = _(
"The following patterns only matched packages " "that are from publishers other than that which " "supplied the already installed version of this package")
s = _(
"'%s' matches multiple packages")
s = _(
"'%s' matches no installed packages")
s = _(
"'%s' is an illegal fmri")
s = _(
"'%s' supports the following architectures: %s")
a = _(
"Image architecture is defined as: %s")
s = _(
"'%(p)s' depends on obsolete package '%(op)s'")
s = _(
"The proposed operation can not be performed for " "the following package(s) as they are already " s = _(
"The following mediations are not syntactically " s = _(
"The following different patterns specify the " res += [_(
"No solution was found to satisfy constraints")]
Syncing this linked image would require the following package updates: res += [
"%(oldfmri)s -> %(newfmri)s\n" % \
The proposed operation on this parent image can not be performed because temporary origins were specified and this image has children. Please either retry the operation again without specifying any temporary origins, or if packages from additional origins are required, please configure those origins res += [_(
"Package %(pkg)s is missing a dependency: " res += [_(
"The following files are not packaged in this image:")]
res += [_(
"Solver dependency errors:")]
res += [_(
"The following packages are already " "installed in this image; use uninstall to " res += [_(
"The following packages are a target " "of group dependencies; use install to unavoid " res += [_(
"The following packages are not on the " "avoid list, so they\ncannot be removed from it.")]
s =
" %s %d: %s" % (_(
"PUBLISHER"), i,
pub)
Invalid child image publisher configuration. Child image publisher configuration must be a superset of the parent image publisher configuration. Please update the child publisher configuration to match the parent. If the child image is a zone this can be done automatically by detaching and The parent image has the following enabled publishers:"""))
The child image has the following enabled publishers:"""))
"""Used to indicate that the imageplan would result in one or more sets of conflicting actions, meaning that more than one action would exist on the system with the same key attribute value in the same namespace. There are three categories, each with its own subclass: - multiple files delivered to the same path or drivers, users, groups, etc, delivered with the same key attribute; - multiple objects delivered to the same path which aren't the same - multiple directories, links, or hardlinks delivered to the same path but with conflicting attributes. """A container for multiple ConflictingActionError exception objects that can be raised as a single exception.""" """Multiple actions of the same type have been delivered with the same key attribute (when not allowed).""" s = _(
"The following packages all deliver %(action)s " "actions to %(kv)s:\n") %
locals()
s += _(
"\n\nThese packages may not be installed together. " "Any non-conflicting set may\nbe, or the packages " "must be corrected before they can be installed.")
s = _(
"The package %(pfmri)s delivers multiple copies " "of %(action)s %(kv)s") %
locals()
s += _(
"\nThis package must be corrected before it " """Multiple actions of different types have been delivered with the same 'path' attribute. While this exception could represent other action groups which share a single namespace, none such exist.""" s = _(
"The following packages deliver conflicting " "action types to %s:\n") %
kv s +=
"".
join(
"\n %s" % p
for p
in pl)
s += _(
"\n\nThese packages may not be installed together. " "Any non-conflicting set may\nbe, or the packages " "must be corrected before they can be installed.")
s = _(
"The package %(pfmri)s delivers conflicting " "action types (%(types)s) to %(kv)s") %
locals()
s += _(
"\nThis package must be corrected before it " """Multiple actions of the same type representing the same object have have been delivered, but with conflicting attributes, such as two directories at /usr with groups 'root' and 'sys', or two 'root' users with uids '0' and '7'.""" # Trim the action's attributes to only those required to be not (k ==
"preserve" and "overlay" in action.
attrs))
or if a[
0].
attrs.
get(
"implicit",
"false") ==
"false":
s = _(
"The requested change to the system attempts to install " "multiple actions\nfor %(a)s '%(k)s' with conflicting " t = _(
" %(n)d package delivers '%(a)s':\n")
t = _(
" %(n)d packages deliver '%(a)s':\n")
t = _(
" %d packages deliver '%s', including:\n")
s += _(
"\nThis package must be corrected before it " s += _(
"\nThese packages may not be installed together." " Any non-conflicting set may\nbe, or the packages " "must be corrected before they can be installed.")
"""Takes a list of items and puts them into a string, with commas in between items, and an "and" between the last two items. Special cases for lists of two or fewer items, and uses the Oxford comma.""" # Used for a two-element list return _(
"%(penultimate)s and %(ultimate)s") % {
# In order to properly i18n this construct, we create two templates: # one for each element save the last, and one that tacks on the last # 'elementtemplate' is for each element through the penultimate # 'listtemplate' concatenates the concatenation of non-ultimate elements # and the ultimate element. """Used to indicate that action execution (such as install, remove, etc.) failed even though the action is valid. In particular, this exception indicates that something went wrong in the application (or unapplication) of the action to the system, and is most likely not an error in the pkg(5) code.""" """'action' is the object for the action that failed during the 'details' is an optional message explaining what operation failed, why it failed, and why it cannot continue. It should also include a suggestion as to how to resolve the situation 'error' is an optional exception object that may have been raised when the operation failed. 'fmri' is an optional package FMRI indicating what package was being operated on at the time the error occurred. 'use_errno' is an optional boolean value indicating whether the strerror() text of the exception should be used. If 'details' is provided, the default value is False, otherwise # If details were provided, don't use errno unless # Fall back on the wrapped exception if we don't have anything details = _(
"Requested operation failed for action " "%(action)s:\n%(details)s") % {
details = _(
"Requested operation failed for package " "%(fmri)s:\n%(details)s") % {
"fmri":
self.
fmri,
# If we only have one of the two, no need for the colon. """Base exception class for all catalog exceptions.""" """Used to indicate that the specified FMRI is not valid for catalog operations because it is missing publisher information.""" return _(
"The FMRI '%s' does not contain publisher information " "and cannot be used for catalog operations.") %
self.
data """Used to indicate an operation on the catalog's meta_root failed because the meta_root is invalid.""" return _(
"Catalog meta_root '%(root)s' is invalid; unable " "to complete operation: '%(op)s'.") % {
"root":
self.
data,
"""Used to indicate the server catalog files do not have the expected """files should contain a list object with each entry consisting of a tuple of filename, expected_mode, received_mode.""" msg = _(
"The following catalog files have incorrect " msg += _(
"\t%(fname)s: expected mode: %(emode)s, found " "mode: %(fmode)s\n") % {
"fname":
fname,
"""Used to indicate that the Catalog signatures are not valid.""" return _(
"The signature data for the '%s' catalog file is not " """Used to indicate that the requested catalog updates could not be applied as the new catalog data is significantly different such that the old catalog cannot be updated to match it.""" return _(
"Unable to determine the updates needed for " "the current catalog using the provided catalog " """Used to indicate that the specified catalog operation could not be performed since it would result in a duplicate catalog entry.""" return _(
"Unable to perform '%(op)s' operation for catalog " "%(name)s; completion would result in a duplicate entry " """Used to indicate that an update request for the catalog could not be performed because update requirements were not satisfied.""" return _(
"Catalog updates can only be applied to an on-disk " """Used to indicate a Catalog file could not be loaded.""" return _(
"Catalog file '%s' is invalid.") %
self.
data """Used to indicate that a Catalog's attributes and parts do not match. This is likely the result of an attributes file being retrieved which doesn't match the parts that were retrieved such as in a misconfigured or stale cache case.""" return _(
"The content of the catalog for publisher '%s' " "doesn't match the catalog's attributes. This is " "likely the result of a mix of older and newer " "catalog files being provided for the publisher.") % \
"""Used to indicate that the specified catalog updates are for an older version of the catalog and cannot be applied.""" return _(
"Unable to determine the updates needed for the " "catalog using the provided catalog update data in '%s'. " "The specified catalog updates are for an older version " "of the catalog and cannot be used.") %
self.
data """Used to indicate that an entry for the specified package FMRI or pattern could not be found in the catalog.""" return _(
"'%s' could not be found in the catalog.") %
self.
data """Used to indicate that the specified CatalogUpdate operation is return _(
"Unknown catalog update type '%s'") %
self.
data """Raised when the catalog finds a CatalogPart that is unrecognized return _(
"Unrecognized, unknown, or invalid CatalogPart '%s'") \
"""Used to indicate that some of the specified patterns to a catalog matching function did not match any catalog entries, or were invalid # Illegal FMRIs have their own __str__ method outstr += _(
"No matching package could be found for " "the following FMRIs in any of the catalogs for " "the current publishers:\n")
outstr += _(
"%s (pattern did not match)\n") % x
outstr += _(
"%s (publisher did not " outstr += _(
"%s (version did not match)\n") % x
"""Based class used for all search-related api exceptions.""" """Raised when the server cannot understand the format of the """Returned when the search cannot find any matches.""" return _(
"The search at url %s returned no results.") %
self.
url """This class wraps exceptions which could appear while trying to s = _(
"Some repositories failed to respond appropriately:\n")
s += _(
"%(o)s:\n%(msg)s\n") % \
s += _(
"%s did not return a valid response.\n" \
s += _(
"Some repositories don't support requested " s += _(
"%(o)s:\n%(msg)s\n") % \
"""This exception is thrown when a local search is performed without an index. It's raised after all results have been yielded.""" return _(
"Search performance is degraded.\n" "Run 'pkg rebuild-index' to improve search speed.")
"""Returned when a search protocol is not supported by the s = _(
"Search repository does not support the requested " s +=
"\nRepository URL: %s" %
self.
url s +=
"\nRequested operation: %s" %
self.
proto """ The base class for all exceptions that can occur while indexing. """ """This is used when the index is not in a correct state.""" """This is used when the existing index is found to have inconsistent """This is used when an attempt to modify an index locked by another process or thread is made.""" """ This is used when the indexer is unable to create, move, or remove files or directories it should be able to. """ return "Could not remove or create " \
"%s because of incorrect " \
"permissions. Please correct this issue then " \
"""This exception is used to wrap an indexing exception during install, uninstall, or update so that a more appropriate error message can be displayed to the user.""" """This exception is used to wrap an indexing exception during install, uninstall, or update which was recovered from by performing a full # Query Parsing Exceptions """This exception is used when the children of a boolean operation have different return types. The command 'pkg search foo AND <bar>' is the simplest example of this.""" """Removal of a package which satisfies dependencies has been attempted. The first argument to the constructor is the FMRI which we tried to remove, and is available as the "fmri" member of the exception. The second argument is the list of dependent packages that prevent the removal of the package, and is available as the "dependents" member. s = _(
"\nThis is happening because the following " "packages needed to be repaired as\npart of this " s += _(
"\n\nYou will need to reestablish your access to the " "repository or remove the\npackages in the list above.")
"""Raised when the depot doesn't have versions of operations that the client needs to operate successfully.""" s = _(
"Unable to contact valid package repository")
s += (
"\nEncountered the following error(s):\n%s") % \
"""Base exception class used for all data related errors.""" """Used to indicate that the specified location does not contain a valid p5i-formatted file.""" return _(
"The provided p5i data is in an unrecognized " "format or does not contain valid publisher " return _(
"The provided p5i data is in an unrecognized format " "or does not contain valid publisher information.")
"""Used to indicate that the specified location does not contain a valid p5i-formatted file.""" return _(
"The provided p5s data is in an unrecognized " "format or does not contain valid publisher " return _(
"The provided p5s data is in an unrecognized format " "or does not contain valid publisher information.")
"""Used to indicate that an attempt to read an unsupported version of pkg(5) info file was attempted.""" return _(
"Unsupported pkg(5) publisher information data " """Used to indicate that an attempt to read an unsupported version of pkg(5) info file was attempted.""" return _(
"Unsupported pkg(5) publisher and image information " """Used to indicate that an attempt to read an unsupported version of pkg(5) info file was attempted.""" return _(
"%s is not a supported version for creating a " """Abstract exception class for all transport exceptions. Specific transport exceptions should be implemented in the transport code. Callers wishing to catch transport exceptions should use this class. Subclasses must implement all methods defined here that raise NotImplementedError.""" """Used to indicate that a a requested resource could not be return _(
"Error encountered while retrieving data from " return _(
"Error encountered while retrieving data from: %s") % \
"""Used to indicate that an invalid transport location was provided.""" return _(
"'%s' is not a valid location.") %
self.
data return _(
"'%s' is not a valid boot environment name.") % \
"""Used to indicate that there is an existing boot environment return _(
"The boot environment '%s' already exists.") % \
Boot environment naming during package install is not supported on this version of OpenSolaris. Please update without the --be-name option.""")
return _(
"Unable to clone the current boot environment.")
A problem occurred while attempting to rename the boot environment currently named %(orig)s to %(dest)s.""") % d
return _(
"Unable to mount %(name)s at %(mt)s") % \
Naming a boot environment when operating on a non-live image is s = _(
"Info does not recognize the following options:")
s += _(
" '") +
str(o) + _(
"'")
"""This is used when the index hash value doesn't match the hash of the packages installed in the image.""" """Base exception class for all publisher exceptions.""" """Used to indicate an operation on the publisher's meta_root failed because the meta_root is invalid.""" return _(
"Publisher meta_root '%(root)s' is invalid; unable " "to complete operation: '%(op)s'.") % {
"root":
self.
data,
"""Used to indicate that a publisher alias is not valid.""" return _(
"'%s' is not a valid publisher alias.") %
self.
data """Used to indicate that a publisher name is not valid.""" return _(
"'%s' is not a valid publisher name.") %
self.
data """Used to indicate that a publisher name is not valid.""" return _(
"'%(pkg_pub)s' is a reserved publisher and does not " "contain the requested package: pkg:/%(pkg_name)s") % \
"""Used to indicate that the specified repository attribute value is return _(
"'%(value)s' is not a valid value for repository " "attribute '%(attribute)s'.") % {
"""Used to indicate that the specified repository collection type is return _(
"'%s' is not a valid repository collection type.") % \
"""Used to indicate that a repository URI is not syntactically valid.""" return _(
"'%s' is not a valid URI.") %
self.
data """Used to indicate that the priority specified for a repository URI is return _(
"'%s' is not a valid URI priority; integer value " """Used to indicate that the specified repository URI sort policy is return _(
"'%s' is not a valid repository URI sort policy.") % \
"""Used to indicate that an attempt to use a disabled publisher occurred return _(
"Publisher '%s' is disabled and cannot be used for " """Used to indicate that a publisher with the same name or alias already return _(
"A publisher with the same name or alias as '%s' " """Used to indicate that a repository with the same origin uris already exists for a publisher.""" return _(
"A repository with the same name or origin URIs " "already exists for publisher '%s'.") %
self.
data """Used to indicate that a repository URI is already in use by another return _(
"Mirror '%s' already exists for the specified " """Used to indicate that a repository URI is already in use by another return _(
"Origin '%s' already exists for the specified " """Used to indicate that a Publisher has no repository information configured and so transport operations cannot be performed.""" return _(
"Unable to retrieve requested package data for " "publisher %s; no repositories are currently configured " """Used to indicate an attempt to search a repo before or after itself""" return _(
"Cannot search a repository before or after itself")
"""Used to indicate an attempt to order a publisher relative to an return _(
"%s is an unknown publisher; no other publishers can " """Used to indicate that an attempt to remove the selected repository for a publisher was made.""" return _(
"Cannot remove the selected repository for a " """Used to indicate that no matching legal URI could be found using the return _(
"Unknown legal URI '%s'.") %
self.
data """Used to indicate that no matching publisher could be found using the return _(
"Unknown publisher '%s'.") %
self.
data """Used to indicate that one or more publisher prefixes are unknown by the specified repository.""" return _(
"The repository at %(location)s does not " "contain package data for %(unknown)s; only " "%(known)s.\n\nThis is either because the " "repository location is not valid, or because the " "provided publisher does not match those known by " return _(
"One or more of the repository origin(s) " "listed below contains package data for " "%(known)s; not %(unknown)s:\n\n%(origins)s\n\n" "This is either because one of the repository " "origins is not valid for this publisher, or " "because the list of known publishers retrieved " "from the repository origin does not match the " return _(
"The specified publisher repository does not " "contain any package data for %(unknown)s; only " """Used to indicate that no matching related URI could be found using the provided criteria.""" return _(
"Unknown related URI '%s'.") %
self.
data """Used to indicate that no matching repository could be found using the return _(
"Unknown repository '%s'.") %
self.
data """Used to indicate that a repository URI could not be found in the list of repository mirrors.""" return _(
"Unknown repository mirror '%s'.") %
self.
data """The publisher has no active repositories that support the return _(
"Publisher '%(pub)s' has no repositories that support " """Used to indicate that the specified repository does not provide publisher configuration information.""" return _(
"The specified package repository does not " "provide publisher configuration information.")
return _(
"The package repository at %s does not " "provide publisher configuration information or " "the information provided is incomplete.") % \
return _(
"One of the package repository origins for %s does " "not provide publisher configuration information or the " "information provided is incomplete.") %
self.
pub """Used to indicate that a repository URI could not be found in the list of repository origins.""" return _(
"Unknown repository origin '%s'") %
self.
data """Used to indicate that the specified repository URI uses an return _(
"The URI '%(uri)s' uses the unsupported " "scheme '%(scheme)s'. Supported schemes are " "file://, http://, and https://.") % {
return _(
"The specified URI uses an unsupported scheme." " Supported schemes are: file://, http://, and https://.")
"""Used to indicate that the specified repository URI attribute is not supported for the URI's scheme.""" return _(
"'%(attr)s' is not supported for '%(scheme)s'.") % {
"""Used when a pkg client needs to communicate with the system repository but can't find the configuration for it.""" pkg is configured to use the system repository (via the use-system-repo property) but it could not get the host and port from the PKG_SYSREPO_URL environment variable was not set. Please try enabling one of those services or setting the PKG_SYSREPO_URL environment variable. """This exception is raised when a user attempts to modify a system """The base class for exceptions related to manifest signing.""" # This string method is used by subclasses to fill in the details # about the package and signature involved. return _(
"The relevant signature action is " "found in %(pfmri)s and has a hash of " return _(
"The package involved is:%s") %
self.
pfmri return _(
"The relevant signature action's value " """Exception used when a key, certificate or CRL file is not in a """Exception used when a signature reports a version which this version of pkg(5) doesn't support.""" return _(
"The signature action %(act)s was made using a " "version (%(ver)s) this version of pkg(5) doesn't " """Base class for exceptions encountered while establishing the chain """Exception used when a certificate does not match its expected hash return _(
"Certificate %s has been modified on disk. Its hash " "value is not what was expected.") %
self.
path """Exception used when a chain of trust is rooted in an untrusted self-signed certificate.""" return _(
"Chain was rooted in an untrusted self-signed " """Exception used when a chain of trust can not be established between 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 = _(
"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 = _(
"The following subprocess returned an " "unexpected exit code of %(rv)d:\n %(cmd)s") % \
err += _(
"\nAnd generated the following error " "message:\n%(errout)s" % {
"errout":
errout})
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'") % {
A '%(op)s' operation failed for child '%(lin)s' with an unexpected return value of %(exitrv)d and the following error message: 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 """Used if an argument to pkg freeze isn't valid.""" The following packages were frozen at two different versions by the patterns provided. The package stem and the versions it was frozen at are The following patterns contained wildcards but matched no The following patterns attempted to freeze the listed packages at a version different from the version at which the packages are installed.""")
The following patterns don't match installed packages and contain no version information. Uninstalled packages can only be frozen by providing a version at which to freeze them.""")
"""Used to indicate the freeze state file could not be loaded.""" return _(
"The freeze state file '%s' is invalid.") %
self.
data """Used when the version on the freeze state file isn't the version return _(
"The freeze state file '%(loc)s' was expected to have " "a version of %(exp)s, but its version was %(found)s") % {
"""Used when JSON has been asked to parse an unparsable string.""" return _(
"Because of this error:\n%(err)s\nJSON could not " "parse the following data:\n%(data)s") % \