api_errors.py revision 941
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# CDDL HEADER START
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# The contents of this file are subject to the terms of the
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# Common Development and Distribution License (the "License").
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# You may not use this file except in compliance with the License.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# or http://www.opensolaris.org/os/licensing.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# See the License for the specific language governing permissions
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# and limitations under the License.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# When distributing Covered Code, include this CDDL HEADER in each
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# If applicable, add the following below this CDDL HEADER, with the
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# fields enclosed by brackets "[]" replaced with your own identifying
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# information: Portions Copyright [yyyy] [name of copyright owner]
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# CDDL HEADER END
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
7f95145833bb24f54e037f73ecc37444d6635697Dwight Engen# Use is subject to license terms.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber# EmptyI for argument defaults; can't import from misc due to circular
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """Used when an image was not found"""
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber def __init__(self, user_specified, user_dir, root_dir):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass NetworkUnavailableException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber def __init__(self, expected_version, received_version):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass PrematureExecutionException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass AlreadyPreparedException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass AlreadyExecutedException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass ImageUpdateOnLiveImageException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass NoPackagesInstalledException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return _("Could not operate on %s\nbecause of "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "insufficient permissions. Please try the command "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "again using pfexec\nor otherwise increase your "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane GraberCould not complete the operation because of insufficient permissions. Please
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Grabertry the command again using pfexec or otherwise increase your privileges.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass FileInUseException(PermissionsException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return _("Could not operate on %s\nbecause the file is "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "in use. Please stop using the file and try the\n"
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber def __init__(self, unfound_fmris=EmptyI, multiple_matches=EmptyI,
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber constraint_violations=EmptyI, badarch=EmptyI):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber self.constraint_violations = constraint_violations
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberpkg: The following pattern(s) did not match any packages in the current
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Grabercatalog. Try relaxing the pattern, refreshing and/or examining the catalogs""")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber res += ["\t%s" % p for p in self.unfound_fmris]
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber s = _("pkg: '%s' matches multiple packages")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber s = _("pkg: '%s' matches no installed packages")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber res += [ s % p for p in self.missing_matches ]
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber s = _("pkg: '%s' is an illegal fmri")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber s = _("pkg: the following package(s) violated "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "constraints:")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber res += ["\t%s" % p for p in self.constraint_violations]
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber s = _("'%s' supports the following architectures: %s")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber a = _("Image architecture is defined as: %s")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber def __init__(self, failed, total, succeeded, message=None):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber def __init__(self, notfound=EmptyI, illegal=EmptyI):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber # Illegal FMRIs have their own __str__ method
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber outstr += _("No matching package could be found for "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "the following FMRIs in any of the catalogs for "
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "the current publishers:\n")
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """ The base class for all exceptions that can occur while indexing. """
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass CorruptedIndexException(IndexingException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """This is used when the index is not in a correct state."""
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass ProblematicPermissionsIndexException(IndexingException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """ This is used when the indexer is unable to create, move, or remove
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber files or directories it should be able to. """
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return "Could not remove or create " \
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "%s because of incorrect " \
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber "permissions. Please correct this issue then " \
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberclass MainDictParsingException(ApiException):
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """This is used when the main dictionary could not parse a line."""
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber """Removal of a package which satisfies dependencies has been attempted.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber The first argument to the constructor is the FMRI which we tried to
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber remove, and is available as the "fmri" member of the exception. The
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber second argument is the list of dependent packages that prevent the
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber removal of the package, and is available as the "dependents" member.
if args:
if args:
if location:
if args:
if args:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri:
if publisher:
if uri:
if uri: