/usr/lib/python3/dist-packages/provisioningserver/rpc/exceptions.py is in python3-maas-provisioningserver 2.0.0~beta3+bzr4941-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Errors arising from the RPC system."""
__all__ = [
"AuthenticationFailed",
"CannotConfigureDHCP",
"CannotCreateHostMap",
"CannotModifyHostMap",
"CannotRegisterCluster",
"CannotRemoveHostMap",
"CommissionNodeFailed",
"NoConnectionsAvailable",
"NodeAlreadyExists",
"NodeStateViolation",
"NoIPFoundForMACAddress",
"NoSuchCluster",
"NoSuchEventType",
"NoSuchNode",
"NoSuchOperatingSystem",
"PowerActionAlreadyInProgress",
"PowerActionFail",
"UnknownPowerType",
"RegistrationFailed",
]
class NoConnectionsAvailable(Exception):
"""There is no connection available."""
def __init__(self, message='', uuid=None):
super(NoConnectionsAvailable, self).__init__(message)
self.uuid = uuid
class NoSuchEventType(Exception):
"""The specified event type was not found."""
@classmethod
def from_name(cls, name):
return cls(
"Event type with name=%s could not be found." % name
)
class NoSuchNode(Exception):
"""The specified node was not found."""
@classmethod
def from_system_id(cls, system_id):
return cls(
"Node with system_id=%s could not be found." % system_id
)
@classmethod
def from_mac_address(cls, mac_address):
return cls(
"Node with mac_address=%s could not be found." % mac_address
)
class NodeStateViolation(Exception):
"""The specified state transition cannot be performed."""
class NoSuchCluster(Exception):
"""The specified cluster was not found."""
@classmethod
def from_uuid(cls, uuid):
return cls(
"The cluster with UUID %s could not "
"be found." % uuid
)
class NoSuchOperatingSystem(Exception):
"""The specified OS was not found."""
class CommissionNodeFailed(Exception):
"""Failure to commission node."""
class CannotConfigureDHCP(Exception):
"""Failure while configuring a DHCP server."""
class CannotCreateHostMap(Exception):
"""The host map could not be created."""
class CannotModifyHostMap(Exception):
"""The host map could not be modified."""
class CannotRemoveHostMap(Exception):
"""The host map could not be removed."""
class NodeAlreadyExists(Exception):
"""A node already exists with a given MAC address."""
class NoIPFoundForMACAddress(Exception):
"""No IP was found for a given MAC address."""
class PowerActionAlreadyInProgress(Exception):
"""A power action was requested on a node where a power action is
already in progress.
"""
class PowerActionFail(Exception):
"""Raised when there's a problem executing a power script."""
class UnknownPowerType(Exception):
"""Raised when trying to process an unknown power type."""
class CannotRegisterCluster(Exception):
"""The cluster could not be registered."""
@classmethod
def from_uuid(cls, uuid, message):
return cls(
"The cluster with UUID %s could not "
"be registered:\n%s" % (uuid, message)
)
class CannotRegisterRackController(Exception):
"""The rack controller could not be registered."""
class AuthenticationFailed(Exception):
"""One or both sides of the connection failed to authenticate."""
class RegistrationFailed(Exception):
"""The region did not or was not able to register the cluster."""
class BootConfigNoResponse(Exception):
"""The region gave no response for the boot configuration."""
|