api_errors.py revision 616
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
class ApiException(Exception):
pass
class ImageNotFoundException(ApiException):
"""Used when an image was not found"""
class VersionException(ApiException):
class InvalidCertException(ApiException):
pass
class PlanExistsException(ApiException):
pass
class AlreadyPreparedException(ApiException):
pass
class AlreadyExecutedException(ApiException):
pass
class ImageplanStateException(ApiException):
class IpkgOutOfDateException(ApiException):
pass
pass
class CanceledException(ApiException):
pass
class PlanMissingException(ApiException):
pass
pass
class PlanCreationException(ApiException):
res = []
if self.unfound_fmris:
s = _("""\
pkg: The following pattern(s) did not match any packages in the current
res += [ s ]
if self.multiple_matches:
s = _("pkg: '%s' matches multiple packages")
for k in lst:
s = _("pkg: '%s' matches no installed packages")
s = _("pkg: '%s' is an illegal fmri")
class CatalogRefreshException(ApiException):
class InventoryException(ApiException):
if notfound is None:
else:
if illegal is None:
else:
outstr = ""
# Illegal FMRIs have their own __str__ method
outstr += "%s\n" % x
outstr += _("No matching package could be found for "
"the following FMRIs in any of the catalogs for "
"the current authorities:\n")
outstr += "%s\n" % x
return outstr
class IndexingException(ApiException):
""" The base class for all exceptions that can occur while indexing. """
"""This is used when the index is not in a correct state."""
pass
""" 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 " \
class NonLeafPackageException(ApiException):
"""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.
"""