exceptions: ResourceNotFound -> NotFoundException

Invert the order of these such that ResourceNotFound is an alias of
NotFoundException rather than the other way around. This is more
consistent with the other HTTP-related exceptions.

Change-Id: I3b669494cf7dc4e540a54070de42b1befe803e14
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2024-06-13 12:39:24 +01:00
parent 0f311ff3e2
commit 14c1ebbeb8
69 changed files with 701 additions and 701 deletions

View File

@ -32,7 +32,7 @@ class Proxy(proxy.Proxy):
:param uuid: The value can be the UUID of a deployable.
:returns: One :class:`~openstack.accelerator.v2.deployable.Deployable`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
deployable matching the criteria could be found.
"""
return self._get(_deployable.Deployable, uuid)
@ -76,7 +76,7 @@ class Proxy(proxy.Proxy):
:param uuid: The value can be the UUID of a device.
:returns: One :class:`~openstack.accelerator.v2.device.Device`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
device matching the criteria could be found.
"""
return self._get(_device.Device, uuid)
@ -106,7 +106,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.accelerator.v2.device_profile.DeviceProfile`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the device profile does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent device profile.
@ -124,7 +124,7 @@ class Proxy(proxy.Proxy):
:param uuid: The value can be the UUID of a device profile.
:returns: One :class:
`~openstack.accelerator.v2.device_profile.DeviceProfile`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
device profile matching the criteria could be found.
"""
return self._get(_device_profile.DeviceProfile, uuid)
@ -158,7 +158,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.accelerator.v2.device_profile.DeviceProfile`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the device profile does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent accelerator request.
@ -176,7 +176,7 @@ class Proxy(proxy.Proxy):
:param uuid: The value can be the UUID of a accelerator request.
:returns: One :class:
`~openstack.accelerator.v2.accelerator_request.AcceleratorRequest`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
accelerator request matching the criteria could be found.
"""
return self._get(_arq.AcceleratorRequest, uuid)

View File

@ -118,7 +118,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The ID of a chassis.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the chassis does not exist. When set to `True``, None will
be returned when attempting to find a nonexistent chassis.
:returns: One :class:`~openstack.baremetal.v1.chassis.Chassis` object
@ -136,7 +136,7 @@ class Proxy(proxy.Proxy):
:param fields: Limit the resource fields to fetch.
:returns: One :class:`~openstack.baremetal.v1.chassis.Chassis`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
chassis matching the name or ID could be found.
"""
return self._get_with_fields(_chassis.Chassis, chassis, fields=fields)
@ -172,7 +172,7 @@ class Proxy(proxy.Proxy):
:param chassis: The value can be either the ID of a chassis or
a :class:`~openstack.baremetal.v1.chassis.Chassis` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the chassis could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
chassis.
@ -206,7 +206,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.driver.Driver` instance.
:returns: One :class:`~openstack.baremetal.v1.driver.Driver`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
driver matching the name could be found.
"""
return self._get(_driver.Driver, driver)
@ -218,7 +218,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.driver.Driver` instance.
:returns: One :dict: of vendor methods with corresponding usages
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
driver matching the name could be found.
"""
driver = self.get_driver(driver)
@ -310,7 +310,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a node.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the node does not exist. When set to `True``, None will
be returned when attempting to find a nonexistent node.
:returns: One :class:`~openstack.baremetal.v1.node.Node` object
@ -328,7 +328,7 @@ class Proxy(proxy.Proxy):
:param fields: Limit the resource fields to fetch.
:returns: One :class:`~openstack.baremetal.v1.node.Node`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
node matching the name or ID could be found.
"""
return self._get_with_fields(_node.Node, node, fields=fields)
@ -340,7 +340,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.node.Node` instance.
:returns: The node inventory
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
inventory could be found.
"""
res = self._get_resource(_node.Node, node)
@ -702,7 +702,7 @@ class Proxy(proxy.Proxy):
:param node: The value can be either the name or ID of a node or
a :class:`~openstack.baremetal.v1.node.Node` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the node could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
node.
@ -773,7 +773,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The ID of a port.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the port does not exist. When set to `True``, None will
be returned when attempting to find a nonexistent port.
:returns: One :class:`~openstack.baremetal.v1.port.Port` object
@ -791,7 +791,7 @@ class Proxy(proxy.Proxy):
:param fields: Limit the resource fields to fetch.
:returns: One :class:`~openstack.baremetal.v1.port.Port`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
port matching the name or ID could be found.
"""
return self._get_with_fields(_port.Port, port, fields=fields)
@ -827,7 +827,7 @@ class Proxy(proxy.Proxy):
:param port: The value can be either the ID of a port or
a :class:`~openstack.baremetal.v1.port.Port` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the port could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
port.
@ -892,7 +892,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a portgroup.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the port group does not exist. When set to `True``, None will
be returned when attempting to find a nonexistent port group.
:returns: One :class:`~openstack.baremetal.v1.port_group.PortGroup`
@ -910,7 +910,7 @@ class Proxy(proxy.Proxy):
:param fields: Limit the resource fields to fetch.
:returns: One :class:`~openstack.baremetal.v1.port_group.PortGroup`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
port group matching the name or ID could be found.
"""
return self._get_with_fields(
@ -952,7 +952,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.port_group.PortGroup`
instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the port group could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
port group.
@ -997,7 +997,7 @@ class Proxy(proxy.Proxy):
a :class:`~openstack.baremetal.v1.node.Node` instance.
:param string vif_id: Backend-specific VIF ID.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the VIF does not exist. Otherwise, ``False``
is returned.
:return: ``True`` if the VIF was detached, otherwise ``False``.
@ -1075,7 +1075,7 @@ class Proxy(proxy.Proxy):
:param fields: Limit the resource fields to fetch.
:returns: One :class:`~openstack.baremetal.v1.allocation.Allocation`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
allocation matching the name or ID could be found.
"""
return self._get_with_fields(
@ -1115,7 +1115,7 @@ class Proxy(proxy.Proxy):
:param allocation: The value can be the name or ID of an allocation or
a :class:`~openstack.baremetal.v1.allocation.Allocation` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the allocation could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
allocation.
@ -1167,7 +1167,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.node.Node` instance.
:param trait: trait to remove from the node.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the trait could not be found. When set to ``True``, no
exception will be raised when attempting to delete a non-existent
trait.
@ -1300,7 +1300,7 @@ class Proxy(proxy.Proxy):
:param str vc_id: The ID of a volume connector.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume connector does not exist. When set to `True``,
None will be returned when attempting to find a nonexistent
volume connector.
@ -1325,7 +1325,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class: `~openstack.baremetal.v1.volume_connector.VolumeConnector`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
volume_connector matching the name or ID could be found.`
"""
return self._get_with_fields(
@ -1375,7 +1375,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.volume_connector.VolumeConnector`
instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume_connector could not be found.
When set to ``True``, no exception will be raised when
attempting to delete a non-existent volume_connector.
@ -1447,7 +1447,7 @@ class Proxy(proxy.Proxy):
:param str vt_id: The ID of a volume target.
:param bool ignore_missing: When set to ``False``, an exception of
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume connector does not exist. When set to `True``,
None will be returned when attempting to find a nonexistent
volume target.
@ -1470,7 +1470,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.baremetal.v1.volume_target.VolumeTarget`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
volume_target matching the name or ID could be found.`
"""
return self._get_with_fields(
@ -1517,7 +1517,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.baremetal.v1.volume_target.VolumeTarget`
instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume_target could not be found.
When set to ``True``, no exception will be raised when
attempting to delete a non-existent volume_target.
@ -1585,7 +1585,7 @@ class Proxy(proxy.Proxy):
instance.
:param bool ignore_missing: When set to ``False``,
an exception:class:`~openstack.exceptions.ResourceNotFound`
an exception:class:`~openstack.exceptions.NotFoundException`
will be raised when the deploy_template
could not be found.
When set to ``True``, no
@ -1616,7 +1616,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.baremetal.v1.deploy_templates.DeployTemplate`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no deployment template matching the name or
ID could be found.
"""
@ -1663,7 +1663,7 @@ class Proxy(proxy.Proxy):
:returns: One :class:`~openstack.baremetal.v1.conductor.Conductor`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
conductor matching the name could be found.
"""
return self._get_with_fields(

View File

@ -847,7 +847,7 @@ class Node(_common.Resource):
:type session: :class:`~keystoneauth1.adapter.Adapter`
:param string vif_id: Backend-specific VIF ID.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the VIF does not exist. Otherwise, ``False``
is returned.
:return: ``True`` if the VIF was detached, otherwise ``False``.
@ -1188,7 +1188,7 @@ class Node(_common.Resource):
:param session: The session to use for making this request.
:param trait: The trait to remove from the node.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the trait does not exist.
Otherwise, ``False`` is returned.
:returns bool: True on success removing the trait.

View File

@ -89,7 +89,7 @@ class Proxy(proxy.Proxy):
introspection (matching bare metal node name or ID) or
an :class:`~.introspection.Introspection` instance.
:returns: :class:`~.introspection.Introspection` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
introspection matching the name or ID could be found.
"""
return self._get(_introspect.Introspection, introspection)
@ -118,7 +118,7 @@ class Proxy(proxy.Proxy):
introspection (matching bare metal node name or ID) or
an :class:`~.introspection.Introspection` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the introspection could not be found. When set to ``True``, no
exception will be raised when attempting to abort a non-existent
introspection.
@ -127,7 +127,7 @@ class Proxy(proxy.Proxy):
res = self._get_resource(_introspect.Introspection, introspection)
try:
res.abort(self)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
if not ignore_missing:
raise
@ -177,7 +177,7 @@ class Proxy(proxy.Proxy):
introspection rule or a
:class:`~.introspection_rule.IntrospectionRule` instance.
:param bool ignore_missing: When set to ``False``, an
exception:class:`~openstack.exceptions.ResourceNotFound` will be
exception:class:`~openstack.exceptions.NotFoundException` will be
raised when the introspection rule could not be found. When set to
``True``, no exception will be raised when attempting to delete a
non-existent introspection rule.
@ -198,7 +198,7 @@ class Proxy(proxy.Proxy):
:class:`~.introspection_rule.IntrospectionRule` instance.
:returns: :class:`~.introspection_rule.IntrospectionRule` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
introspection rule matching the name or ID could be found.
"""
return self._get(

View File

@ -34,7 +34,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
instance.
:returns: One :class:`~openstack.block_storage.v2.snapshot.Snapshot`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_snapshot.Snapshot, snapshot)
@ -51,7 +51,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a snapshot
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the snapshot does not exist. When set to ``True``, None will
be returned when attempting to find a nonexistent resource.
:param bool details: When set to ``False``, an
@ -66,7 +66,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: One :class:`~openstack.block_storage.v2.snapshot.Snapshot`,
one :class:`~openstack.block_storage.v2.snapshot.SnapshotDetail`
object, or None.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -127,7 +127,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the snapshot does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent snapshot.
@ -159,7 +159,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v2.type.Type` instance.
:returns: One :class:`~openstack.block_storage.v2.type.Type`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_type.Type, type)
@ -189,7 +189,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param type: The value can be either the ID of a type or a
:class:`~openstack.block_storage.v2.type.Type` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the type does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent type.
@ -244,7 +244,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v2.volume.Volume` instance.
:returns: One :class:`~openstack.block_storage.v2.volume.Volume`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_volume.Volume, volume)
@ -261,7 +261,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param volume: The name or ID a volume
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume does not exist.
:param bool details: When set to ``False`` no extended attributes
will be returned. The default, ``True``, will cause an object with
@ -272,7 +272,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: One :class:`~openstack.block_storage.v2.volume.Volume` or
None.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -329,7 +329,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param volume: The value can be either the ID of a volume or a
:class:`~openstack.block_storage.v2.volume.Volume` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
volume.
@ -565,14 +565,14 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a backup
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the backup does not exist.
:param bool details: When set to ``False`` no additional details will
be returned. The default, ``True``, will cause objects with
additional attributes to be returned.
:returns: One :class:`~openstack.block_storage.v2.backup.Backup`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -603,7 +603,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param backup: The value can be the ID of a backup or a
:class:`~openstack.block_storage.v2.backup.Backup` instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -669,7 +669,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: One :class:
`~openstack.block_storage.v2.capabilites.Capabilities` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(_capabilities.Capabilities, host)
@ -686,7 +686,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param dict query: Additional query parameters to use.
:returns: One :class:`~openstack.block_storage.v2.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)
@ -703,7 +703,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
which the quota should be retrieved
:returns: One :class:`~openstack.block_storage.v2.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)

View File

@ -67,7 +67,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
instance.
:returns: One :class:`~openstack.block_storage.v3.snapshot.Snapshot`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_snapshot.Snapshot, snapshot)
@ -84,7 +84,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a snapshot
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the snapshot does not exist. When set to ``True``, None will
be returned when attempting to find a nonexistent resource.
:param bool details: When set to ``False`` :class:
@ -96,7 +96,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
a higher chance of duplicates. Admin-only by default.
:returns: One :class:`~openstack.block_storage.v3.snapshot.Snapshot`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -168,7 +168,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The value can be either the ID of a snapshot or a
:class:`~openstack.block_storage.v3.snapshot.Snapshot` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the snapshot does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent snapshot.
@ -290,7 +290,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v3.type.Type` instance.
:returns: One :class:`~openstack.block_storage.v3.type.Type`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_type.Type, type)
@ -300,11 +300,11 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a volume type
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume type does not exist.
:returns: One :class:`~openstack.block_storage.v3.type.Type`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -340,7 +340,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param type: The value can be either the ID of a type or a
:class:`~openstack.block_storage.v3.type.Type` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the type does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent type.
@ -435,7 +435,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
instance.
:returns: One :class:`~openstack.block_storage.v3.type.TypeEncryption`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
volume_type = self._get_resource(_type.Type, volume_type_id)
@ -481,7 +481,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
instance. Required if encryption_id is None.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the type does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent type.
@ -540,7 +540,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v3.volume.Volume` instance.
:returns: One :class:`~openstack.block_storage.v3.volume.Volume`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_volume.Volume, volume)
@ -557,7 +557,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a volume
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume does not exist.
:param bool details: When set to ``False`` no extended attributes
will be returned. The default, ``True``, will cause objects with
@ -567,7 +567,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
a higher chance of duplicates. Admin-only by default.
:returns: One :class:`~openstack.block_storage.v3.volume.Volume`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -624,7 +624,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param volume: The value can be either the ID of a volume or a
:class:`~openstack.block_storage.v3.volume.Volume` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the volume does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent volume.
@ -1066,7 +1066,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~attachment.Attachment` instance.
:returns: One :class:`~attachment.Attachment`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_attachment.Attachment, attachment)
@ -1094,7 +1094,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:class:`~openstack.block_storage.v3.attachment.Attachment`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the attachment does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent attachment.
@ -1196,14 +1196,14 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param snapshot: The name or ID a backup
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the backup does not exist.
:param bool details: When set to ``False`` no additional details will
be returned. The default, ``True``, will cause objects with
additional attributes to be returned.
:returns: One :class:`~openstack.block_storage.v3.backup.Backup`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1234,7 +1234,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param backup: The value can be the ID of a backup or a
:class:`~openstack.block_storage.v3.backup.Backup` instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -1300,7 +1300,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: One :class:
`~openstack.block_storage.v3.capabilites.Capabilities` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(_capabilities.Capabilities, host)
@ -1323,14 +1323,14 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param name_or_id: The name or ID of a group.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the group snapshot does not exist.
:param bool details: When set to ``False``, no additional details will
be returned. The default, ``True``, will cause additional details
to be returned.
:returns: One :class:`~openstack.block_storage.v3.group.Group`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1462,14 +1462,14 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param name_or_id: The name or ID of a group snapshot.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the group snapshot does not exist.
:param bool details: When set to ``False``, no additional details will
be returned. The default, ``True``, will cause additional details
to be returned.
:returns: One :class:`~openstack.block_storage.v3.group_snapshot`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1550,7 +1550,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: One :class:
`~openstack.block_storage.v3.group_type.GroupType` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(_group_type.GroupType, group_type)
@ -1560,12 +1560,12 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param name_or_id: The name or ID of a group type.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the group type does not exist.
:returns: One
:class:`~openstack.block_storage.v3.group_type.GroupType`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1617,7 +1617,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
or a :class:`~openstack.block_storage.v3.group_type.GroupType`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -1713,7 +1713,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param dict query: Additional query parameters to use.
:returns: One :class:`~openstack.block_storage.v3.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)
@ -1730,7 +1730,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
which the quota should be retrieved
:returns: One :class:`~openstack.block_storage.v3.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)
@ -1810,14 +1810,14 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param name_or_id: The name or ID of a service
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist.
When set to ``True``, None will be returned when attempting to find
a nonexistent resource.
:param dict query: Additional attributes like 'host'
:returns: One: class:`~openstack.block_storage.v3.service.Service` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1854,8 +1854,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: Updated service instance
:rtype: class: `~openstack.block_storage.v3.service.Service`
"""
service = self._get_resource(_service.Service, service)
return service.enable(self)
service_obj = self._get_resource(_service.Service, service)
return service_obj.enable(self)
def disable_service(
self,
@ -1872,8 +1872,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: Updated service instance
:rtype: class: `~openstack.block_storage.v3.service.Service`
"""
service = self._get_resource(_service.Service, service)
return service.disable(self, reason=reason)
service_obj = self._get_resource(_service.Service, service)
return service_obj.disable(self, reason=reason)
def thaw_service(
self,
@ -1887,8 +1887,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: Updated service instance
:rtype: class: `~openstack.block_storage.v3.service.Service`
"""
service = self._get_resource(_service.Service, service)
return service.thaw(self)
service_obj = self._get_resource(_service.Service, service)
return service_obj.thaw(self)
def freeze_service(
self,
@ -1902,8 +1902,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: Updated service instance
:rtype: class: `~openstack.block_storage.v3.service.Service`
"""
service = self._get_resource(_service.Service, service)
return service.freeze(self)
service_obj = self._get_resource(_service.Service, service)
return service_obj.freeze(self)
def failover_service(
self,
@ -1922,8 +1922,10 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:returns: Updated service instance
:rtype: class: `~openstack.block_storage.v3.service.Service`
"""
service = self._get_resource(_service.Service, service)
return service.failover(self, cluster=cluster, backend_id=backend_id)
service_obj = self._get_resource(_service.Service, service)
return service_obj.failover(
self, cluster=cluster, backend_id=backend_id
)
# ====== RESOURCE FILTERS ======
def resource_filters(self, **query):
@ -1963,7 +1965,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param transfer: The value can be either the ID of a transfer or a
:class:`~openstack.block_storage.v3.transfer.Transfer`` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the transfer does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent transfer.
@ -1981,11 +1983,11 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
:param name_or_id: The name or ID a transfer
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the volume transfer does not exist.
:returns: One :class:`~openstack.block_storage.v3.transfer.Transfer`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -2004,7 +2006,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
instance.
:returns: One :class:`~openstack.block_storage.v3.transfer.Transfer`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_transfer.Transfer, transfer)

View File

@ -86,7 +86,7 @@ class Service(resource.Resource):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -130,7 +130,7 @@ class Transfer(resource.Resource):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_fetch` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
@ -162,7 +162,7 @@ class Transfer(resource.Resource):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_commit` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""

View File

@ -325,7 +325,7 @@ class ComputeCloudMixin:
try:
self.compute.remove_security_group_from_server(server, sg)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
# NOTE(jamielennox): Is this ok? If we remove something that
# isn't present should we just conclude job done or is that an
# error? Nova returns ok if you try to add a group twice.
@ -561,7 +561,7 @@ class ComputeCloudMixin:
try:
server = self.compute.get_server(id)
return meta.add_server_interfaces(self, server)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
return None
def get_server_group(self, name_or_id=None, filters=None):
@ -612,7 +612,7 @@ class ComputeCloudMixin:
"""
try:
self.compute.delete_keypair(name, ignore_missing=False)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug("Keypair %s not found for deleting", name)
return False
return True
@ -1399,7 +1399,7 @@ class ComputeCloudMixin:
try:
self.compute.delete_server(server)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
return False
except Exception:
raise
@ -1708,7 +1708,7 @@ class ComputeCloudMixin:
try:
self.compute.delete_aggregate(name_or_id, ignore_missing=False)
return True
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug("Aggregate %s not found for deleting", name_or_id)
return False

View File

@ -439,7 +439,7 @@ class FloatingIPCloudMixin:
if network_name_or_id:
try:
network = self.network.find_network(network_name_or_id)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
raise exceptions.NotFoundException(
"unable to find network for floating ips with ID "
"{}".format(network_name_or_id)
@ -592,7 +592,7 @@ class FloatingIPCloudMixin:
def _neutron_delete_floating_ip(self, floating_ip_id):
try:
self.network.delete_ip(floating_ip_id, ignore_missing=False)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
return False
return True

View File

@ -778,7 +778,7 @@ class NetworkCloudMixin:
self.network.delete_firewall_rule(
firewall_rule, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
'Firewall rule %s not found for deleting', name_or_id
)
@ -938,7 +938,7 @@ class NetworkCloudMixin:
:param bool shared: Visibility to other projects.
Defaults to False.
:raises: BadRequestException if parameters are malformed
:raises: ResourceNotFound if a resource from firewall_list not found
:raises: NotFoundException if a resource from firewall_list not found
:returns: The created network ``FirewallPolicy`` object.
"""
if 'firewall_rules' in kwargs:
@ -982,7 +982,7 @@ class NetworkCloudMixin:
self.network.delete_firewall_policy(
firewall_policy, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
'Firewall policy %s not found for deleting', name_or_id
)
@ -1078,7 +1078,7 @@ class NetworkCloudMixin:
:returns: The updated network ``FirewallPolicy`` object.
:raises: BadRequestException if parameters are malformed
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if resource is not found
:raises: NotFoundException if resource is not found
"""
if not filters:
filters = {}
@ -1115,7 +1115,7 @@ class NetworkCloudMixin:
:param insert_before: rule name or id that should succeed added rule
:param dict filters: optional filters
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if firewall policy or any of the firewall
:raises: NotFoundException if firewall policy or any of the firewall
rules (inserted, after, before) is not found.
:return: updated firewall policy
:rtype: FirewallPolicy
@ -1166,7 +1166,7 @@ class NetworkCloudMixin:
:param rule_name_or_id: firewall rule name or id
:param dict filters: optional filters
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if firewall policy is not found
:raises: NotFoundException if firewall policy is not found
:return: updated firewall policy
:rtype: FirewallPolicy
"""
@ -1228,7 +1228,7 @@ class NetworkCloudMixin:
:param shared: Visibility to other projects. Defaults to False.
:raises: BadRequestException if parameters are malformed
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if (ingress-, egress-) firewall policy or
:raises: NotFoundException if (ingress-, egress-) firewall policy or
a port is not found.
:returns: The created network ``FirewallGroup`` object.
"""
@ -1257,7 +1257,7 @@ class NetworkCloudMixin:
self.network.delete_firewall_group(
firewall_group, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
'Firewall group %s not found for deleting', name_or_id
)
@ -1315,7 +1315,7 @@ class NetworkCloudMixin:
:returns: The updated network ``FirewallGroup`` object.
:raises: BadRequestException if parameters are malformed
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if firewall group, a firewall policy
:raises: NotFoundException if firewall group, a firewall policy
(egress, ingress) or port is not found
"""
if not filters:
@ -1339,7 +1339,7 @@ class NetworkCloudMixin:
:param dict firewall_group: firewall group dict
:raises: DuplicateResource on multiple matches
:raises: ResourceNotFound if a firewall policy is not found
:raises: NotFoundException if a firewall policy is not found
"""
for key in ('egress_firewall_policy', 'ingress_firewall_policy'):
if key not in firewall_group:
@ -1665,7 +1665,7 @@ class NetworkCloudMixin:
self.network.delete_qos_bandwidth_limit_rule(
rule_id, policy, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
"QoS bandwidth limit rule {rule_id} not found in policy "
"{policy_id}. Ignoring.".format(
@ -1855,7 +1855,7 @@ class NetworkCloudMixin:
self.network.delete_qos_dscp_marking_rule(
rule_id, policy, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
"QoS DSCP marking rule {rule_id} not found in policy "
"{policy_id}. Ignoring.".format(
@ -2058,7 +2058,7 @@ class NetworkCloudMixin:
self.network.delete_qos_minimum_bandwidth_rule(
rule_id, policy, ignore_missing=False
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
self.log.debug(
"QoS minimum bandwidth rule {rule_id} not found in policy "
"{policy_id}. Ignoring.".format(
@ -2804,7 +2804,7 @@ class NetworkCloudMixin:
:param list[str] name_or_id_list: list of port names or ids
:param dict filters: optional filters
:raises: SDKException on multiple matches
:raises: ResourceNotFound if a port is not found
:raises: NotFoundException if a port is not found
:return: list of port ids
:rtype: list[str]
"""
@ -2812,7 +2812,7 @@ class NetworkCloudMixin:
for name_or_id in name_or_id_list:
port = self.get_port(name_or_id, filters)
if not port:
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f'Port {name_or_id} not found'
)
ids_list.append(port['id'])

View File

@ -456,7 +456,7 @@ class ObjectStoreCloudMixin:
yield from self.object_store.stream_object(
obj, container, chunk_size=resp_chunk_size
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
return
def get_object(
@ -498,7 +498,7 @@ class ObjectStoreCloudMixin:
headers = {k.lower(): v for k, v in obj._last_headers.items()}
return (headers, obj.data)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
return None
def _wait_for_futures(self, futures, raise_on_error=True):

View File

@ -584,7 +584,7 @@ class _OpenStackCloudMixin:
resource_type, name_or_id, *get_args, **get_kwargs
)
return [resource_by_id]
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
pass
if not filters:

View File

@ -27,7 +27,7 @@ class AsyncResource(resource.Resource):
to populate the `Action` with status information.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_commit` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
response = self._raw_delete(session)

View File

@ -68,7 +68,7 @@ class Proxy(proxy.Proxy):
:returns: A :class:`~openstack.clustering.v1.profile_type.ProfileType`
object.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
profile_type matching the name could be found.
"""
return self._get(_profile_type.ProfileType, profile_type)
@ -89,7 +89,7 @@ class Proxy(proxy.Proxy):
:returns: A :class:`~openstack.clustering.v1.policy_type.PolicyType`
object.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
policy_type matching the name could be found.
"""
return self._get(_policy_type.PolicyType, policy_type)
@ -112,7 +112,7 @@ class Proxy(proxy.Proxy):
:param profile: The value can be either the name or ID of a profile or
a :class:`~openstack.clustering.v1.profile.Profile` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the profile could not be found. When set to ``True``, no exception
will be raised when attempting to delete a non-existent profile.
@ -125,7 +125,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a profile.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -143,7 +143,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.clustering.v1.profile.Profile` instance.
:returns: One :class:`~openstack.clustering.v1.profile.Profile`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
profile matching the criteria could be found.
"""
return self._get(_profile.Profile, profile)
@ -219,7 +219,7 @@ class Proxy(proxy.Proxy):
:param cluster: The value can be either the name or ID of a cluster or
a :class:`~openstack.cluster.v1.cluster.Cluster` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the cluster could not be found. When set to ``True``, no exception
will be raised when attempting to delete a non-existent cluster.
:param bool force_delete: When set to ``True``, the cluster deletion
@ -241,7 +241,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a cluster.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -259,7 +259,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.clustering.v1.cluster.Cluster` instance.
:returns: One :class:`~openstack.clustering.v1.cluster.Cluster`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
cluster matching the criteria could be found.
"""
return self._get(_cluster.Cluster, cluster)
@ -560,7 +560,7 @@ class Proxy(proxy.Proxy):
:param node: The value can be either the name or ID of a node or a
:class:`~openstack.cluster.v1.node.Node` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the node could not be found. When set to ``True``, no exception
will be raised when attempting to delete a non-existent node.
:param bool force_delete: When set to ``True``, the node deletion
@ -582,7 +582,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a node.
:param bool ignore_missing: When set to "False"
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the specified node does not exist.
when set to "True", None will be returned when
attempting to find a nonexistent policy
@ -602,7 +602,7 @@ class Proxy(proxy.Proxy):
server should return more details when retrieving the node data.
:returns: One :class:`~openstack.clustering.v1.node.Node`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
node matching the name or ID could be found.
"""
# NOTE: When retrieving node with details (using NodeDetail resource),
@ -741,7 +741,7 @@ class Proxy(proxy.Proxy):
:param policy: The value can be either the name or ID of a policy or a
:class:`~openstack.clustering.v1.policy.Policy` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the policy could not be found. When set to ``True``, no exception
will be raised when attempting to delete a non-existent policy.
@ -754,7 +754,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a policy.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the specified policy does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent policy.
@ -773,7 +773,7 @@ class Proxy(proxy.Proxy):
:returns: A policy object.
:rtype: :class:`~openstack.clustering.v1.policy.Policy`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
policy matching the criteria could be found.
"""
return self._get(_policy.Policy, policy)
@ -856,7 +856,7 @@ class Proxy(proxy.Proxy):
:returns: a cluster-policy binding object.
:rtype: :class:`~openstack.clustering.v1.cluster_policy.CLusterPolicy`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
cluster-policy binding matching the criteria could be found.
"""
return self._get(
@ -893,7 +893,7 @@ class Proxy(proxy.Proxy):
:param receiver: The value can be either the name or ID of a receiver
or a :class:`~openstack.clustering.v1.receiver.Receiver` instance.
:param bool ignore_missing: When set to ``False``, an exception
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the receiver could not be found. When set to ``True``, no exception
will be raised when attempting to delete a non-existent receiver.
@ -908,7 +908,7 @@ class Proxy(proxy.Proxy):
:param str name_or_id: The name or ID of a receiver.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the specified receiver does not exist. When
set to ``True``, None will be returned when attempting to
find a nonexistent receiver.
@ -927,7 +927,7 @@ class Proxy(proxy.Proxy):
:returns: A receiver object.
:rtype: :class:`~openstack.clustering.v1.receiver.Receiver`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
receiver matching the criteria could be found.
"""
return self._get(_receiver.Receiver, receiver)
@ -960,7 +960,7 @@ class Proxy(proxy.Proxy):
:returns: an action object.
:rtype: :class:`~openstack.clustering.v1.action.Action`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
action matching the criteria could be found.
"""
return self._get(_action.Action, action)
@ -1011,7 +1011,7 @@ class Proxy(proxy.Proxy):
:returns: an event object.
:rtype: :class:`~openstack.clustering.v1.event.Event`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
event matching the criteria could be found.
"""
return self._get(_event.Event, event)
@ -1106,7 +1106,7 @@ class Proxy(proxy.Proxy):
:returns: A :class:`~openstack.clustering.v1.profile_type.ProfileType`
object.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
profile_type matching the name could be found.
"""
obj = self._get_resource(_profile_type.ProfileType, profile_type)

View File

@ -75,14 +75,14 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of an extension.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
:returns: One :class:`~openstack.compute.v2.extension.Extension` or
None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -116,7 +116,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a flavor.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param bool get_extra_specs: When set to ``True`` and extra_specs not
@ -126,7 +126,7 @@ class Proxy(proxy.Proxy):
the flavors being returned.
:returns: One :class:`~openstack.compute.v2.flavor.Flavor` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -159,7 +159,7 @@ class Proxy(proxy.Proxy):
:param flavor: The value can be either the ID of a flavor or a
:class:`~openstack.compute.v2.flavor.Flavor` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the flavor does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent flavor.
@ -191,7 +191,7 @@ class Proxy(proxy.Proxy):
extra_specs.
:returns: One :class:`~openstack.compute.v2.flavor.Flavor`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
flavor = self._get(_flavor.Flavor, flavor)
@ -334,7 +334,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.aggregate.Aggregate` instance.
:returns: One :class:`~openstack.compute.v2.aggregate.Aggregate`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_aggregate.Aggregate, aggregate)
@ -344,13 +344,13 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of an aggregate.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:returns: One :class:`~openstack.compute.v2.aggregate.Aggregate`
or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -393,7 +393,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.aggregate.Aggregate`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the aggregate does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent aggregate.
@ -473,7 +473,7 @@ class Proxy(proxy.Proxy):
:param image: The value can be either the ID of an image or a
:class:`~openstack.compute.v2.image.Image` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the image does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent image.
@ -494,13 +494,13 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a image.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
:returns: One :class:`~openstack.compute.v2.image.Image` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -523,7 +523,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.image.Image` instance.
:returns: One :class:`~openstack.compute.v2.image.Image`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
warnings.warn(
@ -633,7 +633,7 @@ class Proxy(proxy.Proxy):
:param keypair: The value can be either the ID of a keypair or a
:class:`~openstack.compute.v2.keypair.Keypair` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the keypair does not exist. When set to ``True``, no exception
will be set when attempting to delete a nonexistent keypair.
:param str user_id: Optional user_id owning the keypair
@ -656,7 +656,7 @@ class Proxy(proxy.Proxy):
:param str user_id: Optional user_id owning the keypair
:returns: One :class:`~openstack.compute.v2.keypair.Keypair`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
attrs = {'user_id': user_id} if user_id else {}
@ -667,13 +667,13 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a keypair.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param str user_id: Optional user_id owning the keypair
:returns: One :class:`~openstack.compute.v2.keypair.Keypair` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -729,7 +729,7 @@ class Proxy(proxy.Proxy):
:param server: The value can be either the ID of a server or a
:class:`~openstack.compute.v2.server.Server` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the server does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent server
@ -756,7 +756,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a server.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param bool details: When set to ``False``
@ -767,7 +767,7 @@ class Proxy(proxy.Proxy):
higher chance of duplicates. Admin-only by default.
:returns: One :class:`~openstack.compute.v2.server.Server` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -791,7 +791,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.server.Server` instance.
:returns: One :class:`~openstack.compute.v2.server.Server`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_server.Server, server)
@ -1380,7 +1380,7 @@ class Proxy(proxy.Proxy):
server or a :class:`~openstack.compute.v2.server.Server`
instance that the interface belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the server interface does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent server interface.
@ -1415,7 +1415,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.compute.v2.server_interface.ServerInterface`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
server_id = self._get_uri_attribute(
@ -1561,7 +1561,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.compute.v2.server_group.ServerGroup`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the server group does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent server group.
@ -1585,7 +1585,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a server group.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param bool all_projects: When set to ``True``, search for server
@ -1594,7 +1594,7 @@ class Proxy(proxy.Proxy):
:returns: One :class:`~openstack.compute.v2.server_group.ServerGroup`
or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1618,7 +1618,7 @@ class Proxy(proxy.Proxy):
:returns:
A :class:`~openstack.compute.v2.server_group.ServerGroup` object.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_server_group.ServerGroup, server_group)
@ -1674,7 +1674,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a hypervisor
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param bool details: When set to ``False``
@ -1683,7 +1683,7 @@ class Proxy(proxy.Proxy):
:returns: One: class:`~openstack.compute.v2.hypervisor.Hypervisor`
or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1705,7 +1705,7 @@ class Proxy(proxy.Proxy):
:returns:
A :class:`~openstack.compute.v2.hypervisor.Hypervisor` object.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_hypervisor.Hypervisor, hypervisor)
@ -1719,7 +1719,7 @@ class Proxy(proxy.Proxy):
:returns:
A :class:`~openstack.compute.v2.hypervisor.Hypervisor` object.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
hypervisor = self._get_resource(_hypervisor.Hypervisor, hypervisor)
@ -1819,14 +1819,14 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or id of a service
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
:param dict query: Additional attributes like 'host'
:returns: One: class:`~openstack.compute.v2.service.Service` or None
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.
@ -1845,7 +1845,7 @@ class Proxy(proxy.Proxy):
The value can be either the ID of a service or a
:class:`~openstack.compute.v2.service.Service` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the service does not exist. When set to ``True``, no exception
will be set when attempting to delete a nonexistent service.
@ -2024,7 +2024,7 @@ class Proxy(proxy.Proxy):
:param volume: The value can be the ID of a volume or a
:class:`~openstack.block_storage.v3.volume.Volume` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the volume attachment does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
volume attachment.
@ -2058,7 +2058,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.compute.v2.volume_attachment.VolumeAttachment`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
server_id = resource.Resource._get_id(server)
@ -2151,7 +2151,7 @@ class Proxy(proxy.Proxy):
server or a :class:`~openstack.compute.v2.server.Server` instance
that the migration belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the server migration does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
server migration.
@ -2215,14 +2215,14 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.server.Server` instance that the
migration belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the server migration does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
server migration.
:returns: One
:class:`~openstack.compute.v2.server_migration.ServerMigration`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
server_id = self._get_uri_attribute(
@ -2279,7 +2279,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.compute.v2.server_diagnostics.ServerDiagnostics`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
server_id = self._get_resource(_server.Server, server).id
@ -2416,7 +2416,7 @@ class Proxy(proxy.Proxy):
:param dict query: Additional query parameters to use.
:returns: One :class:`~openstack.compute.v2.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)
@ -2435,7 +2435,7 @@ class Proxy(proxy.Proxy):
which the quota should be retrieved
:returns: One :class:`~openstack.compute.v2.quota_set.QuotaSet`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
project = self._get_resource(_project.Project, project)
@ -2496,13 +2496,13 @@ class Proxy(proxy.Proxy):
:class:`~openstack.compute.v2.server.Server` instance that the
action is associated with.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the server action does not exist. When set to ``True``, no
exception will be set when attempting to retrieve a non-existent
server action.
:returns: One :class:`~openstack.compute.v2.server_action.ServerAction`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
server_id = self._get_uri_attribute(server_action, server, 'server_id')

View File

@ -83,7 +83,7 @@ class Service(resource.Resource):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -51,7 +51,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.container_infrastructure_management.v1.cluster.Cluster`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the cluster does not exist. When set to ``True``, no exception will
be set when attempting to delete a nonexistent cluster.
:returns: ``None``
@ -63,7 +63,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a cluster.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -86,7 +86,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.container_infrastructure_management.v1.cluster.Cluster`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_cluster.Cluster, cluster)
@ -139,7 +139,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the cluster_template does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
cluster_template.
@ -156,7 +156,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a cluster_template.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -180,7 +180,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.container_infrastructure_management.v1.cluster_template.ClusterTemplate`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_cluster_template.ClusterTemplate, cluster_template)
@ -237,7 +237,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.container_infrastructure_management.v1.cluster_certificate.ClusterCertificate`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_cluster_cert.ClusterCertificate, cluster_certificate)

View File

@ -134,7 +134,7 @@ class Cluster(resource.Resource):
:param nodes_to_remove: The server ID list will be removed if
downsizing the cluster.
:returns: The UUID of the resized cluster.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
url = utils.urljoin(Cluster.base_path, self.id, 'actions', 'resize')
@ -154,7 +154,7 @@ class Cluster(resource.Resource):
:param max_batch_size: The max batch size each time when doing upgrade.
The default is 1
:returns: The UUID of the updated cluster.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
url = utils.urljoin(Cluster.base_path, self.id, 'actions', 'upgrade')

View File

@ -52,7 +52,7 @@ class Proxy(proxy.Proxy):
It can be either the ID of an instance
or a :class:`~openstack.database.v1.instance.Instance`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the database does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent database.
@ -76,7 +76,7 @@ class Proxy(proxy.Proxy):
:param instance: This can be either the ID of an instance
or a :class:`~openstack.database.v1.instance.Instance`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -117,7 +117,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.database.v1.database.Database`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_database.Database, database)
@ -127,7 +127,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a flavor.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -144,7 +144,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.database.v1.flavor.Flavor` instance.
:returns: One :class:`~openstack.database.v1.flavor.Flavor`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_flavor.Flavor, flavor)
@ -178,7 +178,7 @@ class Proxy(proxy.Proxy):
:param instance: The value can be either the ID of an instance or a
:class:`~openstack.database.v1.instance.Instance` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the instance does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent instance.
@ -194,7 +194,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -212,7 +212,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.database.v1.instance.Instance`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_instance.Instance, instance)
@ -266,7 +266,7 @@ class Proxy(proxy.Proxy):
It can be either the ID of an instance
or a :class:`~openstack.database.v1.instance.Instance`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the user does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent user.
@ -288,7 +288,7 @@ class Proxy(proxy.Proxy):
:param instance: This can be either the ID of an instance
or a :class:`~openstack.database.v1.instance.Instance`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -327,7 +327,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.database.v1.instance.Instance`
:returns: One :class:`~openstack.database.v1.user.User`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
instance = self._get_resource(_instance.Instance, instance)

View File

@ -27,7 +27,7 @@ class Resource(resource.Resource):
:param name_or_id: This resource's identifier, if needed by
the request. The default is ``None``.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -40,7 +40,7 @@ class Resource(resource.Resource):
or None if nothing matches.
:raises: :class:`openstack.exceptions.DuplicateResource` if more
than one resource is found for this request.
:raises: :class:`openstack.exceptions.ResourceNotFound` if nothing
:raises: :class:`openstack.exceptions.NotFoundException` if nothing
is found and ignore_missing is ``False``.
"""
session = cls._get_session(session)
@ -68,7 +68,7 @@ class Resource(resource.Resource):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -77,7 +77,7 @@ class Proxy(proxy.Proxy):
:param zone: The value can be the ID of a zone
or a :class:`~openstack.dns.v2.zone.Zone` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -111,7 +111,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a zone
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the zone does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent zone.
@ -221,7 +221,7 @@ class Proxy(proxy.Proxy):
:param zone: The value can be the ID of a zone
or a :class:`~openstack.dns.v2.zone.Zone` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist. When set to ``True``, no exception will
be set when attempting to delete a nonexistent zone.
@ -242,7 +242,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.dns.v2.zone.Zone` instance.
:param name_or_id: The name or ID of a zone
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the zone does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent zone.
@ -303,7 +303,7 @@ class Proxy(proxy.Proxy):
:param zone_import: The value can be the ID of a zone import
or a :class:`~openstack.dns.v2.zone_import.ZoneImport` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -380,7 +380,7 @@ class Proxy(proxy.Proxy):
:param zone_export: The value can be the ID of a zone import
or a :class:`~openstack.dns.v2.zone_export.ZoneExport` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -510,7 +510,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.dns.v2.zone_transfer.ZoneTransferRequest`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone.
@ -600,7 +600,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.dns.v2.zone.Zone` instance.
:param zone_share_id: The zone share ID
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the zone share does not exist.
When set to ``True``, None will be returned when attempting to
find a nonexistent zone share.
@ -641,7 +641,7 @@ class Proxy(proxy.Proxy):
share or a :class:`~openstack.dns.v2.zone_share.ZoneShare` instance
that the zone share belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the zone share does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent zone share.

View File

@ -120,6 +120,10 @@ class BadRequestException(HttpException):
"""HTTP 400 Bad Request."""
class NotFoundException(HttpException):
"""HTTP 404 Not Found."""
class ForbiddenException(HttpException):
"""HTTP 403 Forbidden Request."""
@ -154,13 +158,6 @@ class DuplicateResource(SDKException):
"""More than one resource exists with that name."""
class ResourceNotFound(HttpException):
"""No resource exists with that name or ID."""
NotFoundException = ResourceNotFound
class ResourceTimeout(SDKException):
"""Timeout waiting for resource."""
@ -275,3 +272,4 @@ class ServiceDiscoveryException(SDKException):
# Backwards compatibility
OpenStackCloudException = SDKException
ResourceNotFound = NotFoundException

View File

@ -34,7 +34,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.identity.v2.extension.Extension`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no extension can be found.
"""
return self._get(_extension.Extension, extension)
@ -57,7 +57,7 @@ class Proxy(proxy.Proxy):
:param role: The value can be either the ID of a role or a
:class:`~openstack.identity.v2.role.Role` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the role does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent role.
@ -71,7 +71,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a role.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -88,7 +88,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v2.role.Role` instance.
:returns: One :class:`~openstack.identity.v2.role.Role`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_role.Role, role)
@ -135,7 +135,7 @@ class Proxy(proxy.Proxy):
:param tenant: The value can be either the ID of a tenant or a
:class:`~openstack.identity.v2.tenant.Tenant` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the tenant does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent tenant.
@ -149,7 +149,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a tenant.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -166,7 +166,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v2.tenant.Tenant` instance.
:returns: One :class:`~openstack.identity.v2.tenant.Tenant`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_tenant.Tenant, tenant)
@ -213,7 +213,7 @@ class Proxy(proxy.Proxy):
:param user: The value can be either the ID of a user or a
:class:`~openstack.identity.v2.user.User` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the user does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent user.
@ -227,7 +227,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a user.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -244,7 +244,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v2.user.User` instance.
:returns: One :class:`~openstack.identity.v2.user.User`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_user.User, user)

View File

@ -108,7 +108,7 @@ class Proxy(proxy.Proxy):
:param credential: The value can be either the ID of a credential or a
:class:`~openstack.identity.v3.credential.Credential` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the credential does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent credential.
@ -124,7 +124,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a credential.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -142,7 +142,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.credential.Credential` instance.
:returns: One :class:`~openstack.identity.v3.credential.Credential`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_credential.Credential, credential)
@ -192,7 +192,7 @@ class Proxy(proxy.Proxy):
:param domain: The value can be either the ID of a domain or a
:class:`~openstack.identity.v3.domain.Domain` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the domain does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent domain.
@ -206,7 +206,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a domain.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -223,7 +223,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.domain.Domain` instance.
:returns: One :class:`~openstack.identity.v3.domain.Domain`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_domain.Domain, domain)
@ -280,7 +280,7 @@ class Proxy(proxy.Proxy):
:param domain: The value can be the ID of a domain or a
a :class:`~openstack.identity.v3.domain.Domain` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the identity provider does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent config for a domain.
@ -302,7 +302,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.identity.v3.domain_config.DomainConfig`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
domain_id = resource.Resource._get_id(domain)
@ -350,7 +350,7 @@ class Proxy(proxy.Proxy):
:param endpoint: The value can be either the ID of an endpoint or a
:class:`~openstack.identity.v3.endpoint.Endpoint` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the endpoint does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent endpoint.
@ -366,7 +366,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a endpoint.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -384,7 +384,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.identity.v3.endpoint.Endpoint`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_endpoint.Endpoint, endpoint)
@ -434,7 +434,7 @@ class Proxy(proxy.Proxy):
:param group: The value can be either the ID of a group or a
:class:`~openstack.identity.v3.group.Group` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the group does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent group.
@ -448,7 +448,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a group.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -469,7 +469,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.identity.v3.group.Group`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_group.Group, group)
@ -572,7 +572,7 @@ class Proxy(proxy.Proxy):
:param policy: The value can be either the ID of a policy or a
:class:`~openstack.identity.v3.policy.Policy` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the policy does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent policy.
@ -586,7 +586,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a policy.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -603,7 +603,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.policy.Policy` instance.
:returns: One :class:`~openstack.identity.v3.policy.Policy`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_policy.Policy, policy)
@ -653,7 +653,7 @@ class Proxy(proxy.Proxy):
:param project: The value can be either the ID of a project or a
:class:`~openstack.identity.v3.project.Project` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the project does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent project.
@ -667,7 +667,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a project.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -687,7 +687,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.project.Project` instance.
:returns: One :class:`~openstack.identity.v3.project.Project`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_project.Project, project)
@ -752,7 +752,7 @@ class Proxy(proxy.Proxy):
:param service: The value can be either the ID of a service or a
:class:`~openstack.identity.v3.service.Service` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the service does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent service.
@ -766,7 +766,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a service.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -783,7 +783,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.service.Service` instance.
:returns: One :class:`~openstack.identity.v3.service.Service`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_service.Service, service)
@ -833,7 +833,7 @@ class Proxy(proxy.Proxy):
:param user: The value can be either the ID of a user or a
:class:`~openstack.identity.v3.user.User` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the user does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent user.
@ -847,7 +847,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a user.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -867,7 +867,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.user.User` instance.
:returns: One :class:`~openstack.identity.v3.user.User`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_user.User, user)
@ -917,7 +917,7 @@ class Proxy(proxy.Proxy):
:param trust: The value can be either the ID of a trust or a
:class:`~openstack.identity.v3.trust.Trust` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the credential does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent credential.
@ -931,7 +931,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a trust.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -948,7 +948,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.trust.Trust` instance.
:returns: One :class:`~openstack.identity.v3.trust.Trust`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_trust.Trust, trust)
@ -985,7 +985,7 @@ class Proxy(proxy.Proxy):
:param region: The value can be either the ID of a region or a
:class:`~openstack.identity.v3.region.Region` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the region does not exist.
When set to ``True``, no exception will be thrown when
attempting to delete a nonexistent region.
@ -999,7 +999,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a region.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the region does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent region.
@ -1016,7 +1016,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.region.Region` instance.
:returns: One :class:`~openstack.identity.v3.region.Region`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no matching region can be found.
"""
return self._get(_region.Region, region)
@ -1066,7 +1066,7 @@ class Proxy(proxy.Proxy):
:param role: The value can be either the ID of a role or a
:class:`~openstack.identity.v3.role.Role` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the role does not exist.
When set to ``True``, no exception will be thrown when
attempting to delete a nonexistent role.
@ -1080,7 +1080,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a role.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the role does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent role.
@ -1100,7 +1100,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.role.Role` instance.
:returns: One :class:`~openstack.identity.v3.role.Role`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no matching role can be found.
"""
return self._get(_role.Role, role)
@ -1543,7 +1543,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.identity.v3.registered_limit.RegisteredLimit`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_registered_limit.RegisteredLimit, registered_limit)
@ -1585,7 +1585,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.registered_limit.RegisteredLimit`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the registered_limit does not exist. When set to ``True``, no
exception will be thrown when attempting to delete a nonexistent
registered_limit.
@ -1618,7 +1618,7 @@ class Proxy(proxy.Proxy):
or a :class:`~openstack.identity.v3.limit.Limit` instance.
:returns: One :class:`~openstack.identity.v3.limit.Limit`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(_limit.Limit, limit)
@ -1654,7 +1654,7 @@ class Proxy(proxy.Proxy):
:param limit: The value can be either the ID of a limit or a
:class:`~openstack.identity.v3.limit.Limit` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the limit does not exist. When set to ``True``, no exception will
be thrown when attempting to delete a nonexistent limit.
@ -1697,7 +1697,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.identity.v3.application_credential.ApplicationCredential`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
user = self._get_resource(_user.User, user)
@ -1745,7 +1745,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.user.User` instance.
:param name_or_id: The name or ID of an application credential.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -1775,7 +1775,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.application_credential.ApplicationCredential`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the application credential does not exist. When set to
``True``, no exception will be thrown when attempting to delete
a nonexistent application credential.
@ -1831,7 +1831,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.federation_protocol.FederationProtocol`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the federation protocol does not exist. When set to
``True``, no exception will be set when attempting to delete a
nonexistent federation protocol.
@ -1856,7 +1856,7 @@ class Proxy(proxy.Proxy):
representing the identity provider the protocol is attached to.
:param protocol: The name or ID of a federation protocol.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the resource does not exist. When set to ``True``, None will
be returned when attempting to find a nonexistent resource.
:returns: One federation protocol or None
@ -1888,7 +1888,7 @@ class Proxy(proxy.Proxy):
:returns: One federation protocol
:rtype:
:class:`~openstack.identity.v3.federation_protocol.FederationProtocol`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
cls = _federation_protocol.FederationProtocol
@ -1966,7 +1966,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.mapping.Mapping`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the mapping does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent mapping.
@ -1980,7 +1980,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a mapping.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -1998,7 +1998,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.identity.v3.mapping.Mapping`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_mapping.Mapping, mapping)
@ -2049,7 +2049,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.identity_provider.IdentityProvider`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the identity provider does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent identity provider.
@ -2067,7 +2067,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of an identity provider
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -2091,7 +2091,7 @@ class Proxy(proxy.Proxy):
:returns: The details of an identity provider.
:rtype:
:class:`~openstack.identity.v3.identity_provider.IdentityProvider`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -2152,7 +2152,7 @@ class Proxy(proxy.Proxy):
:class:`~.access_rule.AccessRule` instance.
:returns: One :class:`~.access_rule.AccessRule`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
user = self._get_resource(_user.User, user)
@ -2166,7 +2166,7 @@ class Proxy(proxy.Proxy):
:param access rule: The value can be either the ID of an
access rule or a :class:`~.access_rule.AccessRule` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the access rule does not exist. When set to ``True``, no exception
will be thrown when attempting to delete a nonexistent access rule.
@ -2202,7 +2202,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.identity.v3.service_provider.ServiceProvider`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the service provider does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent service provider.
@ -2220,7 +2220,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a service provider
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
@ -2245,7 +2245,7 @@ class Proxy(proxy.Proxy):
:returns: The details of an service provider.
:rtype:
:class:`~openstack.identity.v3.service_provider.ServiceProvider`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_service_provider.ServiceProvider, service_provider)

View File

@ -322,7 +322,7 @@ class Proxy(proxy.Proxy):
:param image: The value can be either the ID of an image or a
:class:`~openstack.image.v1.image.Image` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the image does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent image.
@ -336,7 +336,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a image.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -353,7 +353,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v1.image.Image` instance.
:returns: One :class:`~openstack.image.v1.image.Image`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_image.Image, image)

View File

@ -96,7 +96,7 @@ class Image(resource.Resource, _download.DownloadMixin):
:param name_or_id: This resource's identifier, if needed by
the request. The default is ``None``.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -109,7 +109,7 @@ class Image(resource.Resource, _download.DownloadMixin):
or None if nothing matches.
:raises: :class:`openstack.exceptions.DuplicateResource` if more
than one resource is found for this request.
:raises: :class:`openstack.exceptions.ResourceNotFound` if nothing
:raises: :class:`openstack.exceptions.NotFoundException` if nothing
is found and ignore_missing is ``False``.
"""
session = cls._get_session(session)
@ -134,6 +134,6 @@ class Image(resource.Resource, _download.DownloadMixin):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -90,7 +90,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.image.Image`
instance.
:param bool ignore_missing: When set to ``False``,
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the metadef namespace does not exist.
:returns: ``None``
"""
@ -832,7 +832,7 @@ class Proxy(proxy.Proxy):
image is associated with. If specified, the image will only be
deleted from the specified store.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the image does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent image.
@ -850,7 +850,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a image.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -869,7 +869,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.image.Image` instance.
:returns: One :class:`~openstack.image.v2.image.Image`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_image.Image, image)
@ -1018,7 +1018,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.image.Image` instance that the member
is part of. This is required if ``member`` is an ID.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the member does not exist. When set to ``True``, no exception will
be set when attempting to delete a nonexistent member.
@ -1041,7 +1041,7 @@ class Proxy(proxy.Proxy):
the value can be the ID of a image or a
:class:`~openstack.image.v2.image.Image` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -1064,7 +1064,7 @@ class Proxy(proxy.Proxy):
The value can be the ID of a image or a
:class:`~openstack.image.v2.image.Image` instance.
:returns: One :class:`~openstack.image.v2.member.Member`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
member_id = resource.Resource._get_id(member)
@ -1136,7 +1136,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
instance.
:param bool ignore_missing: When set to ``False``,
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the metadef namespace does not exist.
:returns: ``None``
"""
@ -1159,7 +1159,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~~openstack.image.v2.metadef_namespace.MetadefNamespace`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(
@ -1172,7 +1172,7 @@ class Proxy(proxy.Proxy):
:returns: A generator object of metadef namespaces
:rtype: :class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._list(_metadef_namespace.MetadefNamespace, **query)
@ -1234,7 +1234,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
instance.
:returns: One :class:`~openstack.image.v2.metadef_object.MetadefObject`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
object_name = resource.Resource._get_id(metadef_object)
@ -1254,7 +1254,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.image.v2.metadef_object.MetadefObject`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace_name = resource.Resource._get_id(namespace)
@ -1276,7 +1276,7 @@ class Proxy(proxy.Proxy):
a :class:`~openstack.image.v2.metadef_object.MetadefObject`
:returns: One :class:`~openstack.image.v2.metadef_object.MetadefObject`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace_name = resource.Resource._get_id(namespace)
@ -1301,7 +1301,7 @@ class Proxy(proxy.Proxy):
a :class:`~openstack.image.v2.metadef_object.MetadefObject`
:returns: ``None``
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace_name = resource.Resource._get_id(namespace)
@ -1320,7 +1320,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
instance.
:returns: ``None``
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace = self._get_resource(
@ -1335,7 +1335,7 @@ class Proxy(proxy.Proxy):
:return: A generator object of metadef resource types
:rtype:
:class:`~openstack.image.v2.metadef_resource_type.MetadefResourceType`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._list(_metadef_resource_type.MetadefResourceType, **query)
@ -1382,7 +1382,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
instance
:param bool ignore_missing: When set to ``False``,
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the metadef resource type association does not exist.
:returns: ``None``
"""
@ -1404,7 +1404,7 @@ class Proxy(proxy.Proxy):
:return: A generator object of metadef resource type associations
:rtype:
:class:`~openstack.image.v2.metadef_resource_type.MetadefResourceTypeAssociation`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
namespace_name = resource.Resource._get_id(metadef_namespace)
@ -1477,7 +1477,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.metadef_namespace.MetadefNamespace`
instance
:param bool ignore_missing: When set to
``False`` :class:`~openstack.exceptions.ResourceNotFound` will be
``False`` :class:`~openstack.exceptions.NotFoundException` will be
raised when the instance does not exist. When set to ``True``,
no exception will be set when attempting to delete a nonexistent
instance.
@ -1529,7 +1529,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~~openstack.image.v2.metadef_property.MetadefProperty`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace_name = resource.Resource._get_id(metadef_namespace)
@ -1549,7 +1549,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: ``None``
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
namespace = self._get_resource(
@ -1562,7 +1562,7 @@ class Proxy(proxy.Proxy):
"""Get images schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1575,7 +1575,7 @@ class Proxy(proxy.Proxy):
"""Get single image schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1588,7 +1588,7 @@ class Proxy(proxy.Proxy):
"""Get image members schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1601,7 +1601,7 @@ class Proxy(proxy.Proxy):
"""Get image member schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1614,7 +1614,7 @@ class Proxy(proxy.Proxy):
"""Get image tasks schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1627,7 +1627,7 @@ class Proxy(proxy.Proxy):
"""Get image task schema
:returns: One :class:`~openstack.image.v2.schema.Schema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1640,7 +1640,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition namespace schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1653,7 +1653,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition namespaces schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1666,7 +1666,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition resource type association schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1679,7 +1679,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition resource type associations schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1692,7 +1692,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition object schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1705,7 +1705,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition objects schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1718,7 +1718,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition property schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1731,7 +1731,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition properties schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1744,7 +1744,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition tag schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1757,7 +1757,7 @@ class Proxy(proxy.Proxy):
"""Get metadata definition tags schema
:returns: One :class:`~openstack.image.v2.metadef_schema.MetadefSchema`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(
@ -1785,7 +1785,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.image.v2.task.Task` instance.
:returns: One :class:`~openstack.image.v2.task.Task`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_task.Task, task)
@ -1895,7 +1895,7 @@ class Proxy(proxy.Proxy):
"""Get a info about image constraints
:returns: One :class:`~openstack.image.v2.service_info.Import`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_si.Import, requires_id=False)

View File

@ -418,6 +418,6 @@ class Image(resource.Resource, tag.TagMixin, _download.DownloadMixin):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -47,7 +47,7 @@ class Store(resource.Resource):
:class:`~openstack.image.v2.image.Image` instance.
:returns: The result of the ``delete`` if resource found, else None.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when
:raises: :class:`~openstack.exceptions.NotFoundException` when
ignore_missing if ``False`` and a nonexistent resource
is attempted to be deleted.
"""
@ -57,7 +57,7 @@ class Store(resource.Resource):
try:
response = session.delete(url)
exceptions.raise_from_response(response)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
if ignore_missing:
return None
raise

View File

@ -51,7 +51,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One
:class:`~masakariclient.sdk.ha.v1.notification.Notification`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_notification.Notification, notification)
@ -82,7 +82,7 @@ class Proxy(proxy.Proxy):
:param segment: The value can be the ID of a segment or a
:class:`~masakariclient.sdk.ha.v1.segment.Segment` instance.
:returns: One :class:`~masakariclient.sdk.ha.v1.segment.Segment`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_segment.Segment, segment)
@ -118,7 +118,7 @@ class Proxy(proxy.Proxy):
The value can be either the ID of a segment or a
:class:`~masakariclient.sdk.ha.v1.segment.Segment` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the segment does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent segment.
@ -159,7 +159,7 @@ class Proxy(proxy.Proxy):
`~masakariclient.sdk.ha.v1.host.Host` instance.
:returns: One :class:`~masakariclient.sdk.ha.v1.host.Host`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.InvalidRequest`
when segment_id is None.
@ -179,7 +179,7 @@ class Proxy(proxy.Proxy):
:param dict attrs: The attributes to update on the host represented.
:returns: The updated host
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.InvalidRequest`
when segment_id is None.
@ -196,13 +196,13 @@ class Proxy(proxy.Proxy):
:param host: The value can be the ID of a host or a :class:
`~masakariclient.sdk.ha.v1.host.Host` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the host does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent host.
:returns: ``None``
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.InvalidRequest`
when segment_id is None.
@ -246,7 +246,7 @@ class Proxy(proxy.Proxy):
a :class: `~masakariclient.sdk.ha.v1.notification.Notification`
instance.
:returns: one 'VMove' resource class.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:raises: :class:`~openstack.exceptions.InvalidRequest`
when notification_id is None.

View File

@ -42,7 +42,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.key_manager.v1.container.Container`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the container does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent container.
@ -58,7 +58,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a container.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -77,7 +77,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.key_manager.v1.container.Container`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_container.Container, container)
@ -125,7 +125,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.key_manager.v1.order.Order`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the order does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent order.
@ -139,7 +139,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a order.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -157,7 +157,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.key_manager.v1.order.Order`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_order.Order, order)
@ -205,7 +205,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.key_manager.v1.secret.Secret`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the secret does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent secret.
@ -219,7 +219,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a secret.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -238,7 +238,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.key_manager.v1.secret.Secret`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_secret.Secret, secret)

View File

@ -102,7 +102,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.load_balancer.LoadBalancer`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the load balancer does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent load balancer.
@ -122,7 +122,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a load balancer
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the load balancer does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent load balancer.
@ -216,7 +216,7 @@ class Proxy(proxy.Proxy):
:param listener: The value can be either the ID of a listener or a
:class:`~openstack.load_balancer.v2.listener.Listener` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the listner does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent listener.
@ -232,7 +232,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a listener.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -252,7 +252,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.load_balancer.v2.listener.Listener`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_listener.Listener, listener)
@ -266,7 +266,7 @@ class Proxy(proxy.Proxy):
:returns: One
:class:`~openstack.load_balancer.v2.listener.ListenerStats`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
return self._get(
@ -335,7 +335,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.pool.Pool`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the pool does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent pool.
@ -349,7 +349,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a pool
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the pool does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent pool.
@ -400,7 +400,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.pool.Pool` instance
that the member belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the member does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent member.
@ -423,7 +423,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.pool.Pool` instance
that the member belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -450,7 +450,7 @@ class Proxy(proxy.Proxy):
that the member belongs to.
:returns: One :class:`~openstack.load_balancer.v2.member.Member`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
poolobj = self._get_resource(_pool.Pool, pool)
@ -496,7 +496,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a health monitor
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the health monitor does not exist.
When set to ``True``, no exception will be set when attempting
to find a nonexistent health monitor.
@ -507,7 +507,7 @@ class Proxy(proxy.Proxy):
:raises: :class:`openstack.exceptions.DuplicateResource` if more
than one resource is found for this request.
:raises: :class:`openstack.exceptions.ResourceNotFound` if nothing
:raises: :class:`openstack.exceptions.NotFoundException` if nothing
is found and ignore_missing is ``False``.
"""
return self._find(
@ -565,7 +565,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.healthmonitor.HealthMonitor`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the healthmonitor does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent healthmonitor.
@ -610,7 +610,7 @@ class Proxy(proxy.Proxy):
:param l7_policy: The value can be either the ID of a l7policy or a
:class:`~openstack.load_balancer.v2.l7_policy.L7Policy` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the l7policy does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent l7policy.
@ -626,7 +626,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a l7policy.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -646,7 +646,7 @@ class Proxy(proxy.Proxy):
instance.
:returns: One :class:`~openstack.load_balancer.v2.l7_policy.L7Policy`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_l7policy.L7Policy, l7_policy)
@ -703,7 +703,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.l7_policy.L7Policy`
instance that the l7rule belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the l7rule does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent l7rule.
@ -726,7 +726,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.l7_policy.L7Policy`
instance that the l7rule belongs to.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -753,7 +753,7 @@ class Proxy(proxy.Proxy):
instance that the l7rule belongs to.
:returns: One :class:`~openstack.load_balancer.v2.l7_rule.L7Rule`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
l7policyobj = self._get_resource(_l7policy.L7Policy, l7_policy)
@ -815,7 +815,7 @@ class Proxy(proxy.Proxy):
ID for the quota.
:returns: One :class:`~openstack.load_balancer.v2.quota.Quota`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_quota.Quota, quota)
@ -850,7 +850,7 @@ class Proxy(proxy.Proxy):
instance. The ID of a quota is the same as the
project ID for the quota.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when quota does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent quota.
@ -914,7 +914,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.flavor_profile.FlavorProfile`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the flavor profile does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent flavor profile.
@ -932,7 +932,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a flavor profile
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the flavor profile does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent flavor profile.
@ -998,7 +998,7 @@ class Proxy(proxy.Proxy):
:param flavor: The flavorcan be either the ID or a
:class:`~openstack.load_balancer.v2.flavor.Flavor` instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the flavor does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent flavor.
@ -1012,7 +1012,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a flavor
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the flavor does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent flavor.
@ -1059,7 +1059,7 @@ class Proxy(proxy.Proxy):
:param amphora_id: The ID of a amphora
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the amphora does not exist.
When set to ``True``, no exception will be set when attempting
to find a nonexistent amphora.
@ -1138,7 +1138,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.availability_zone_profile.AvailabilityZoneProfile`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the availability zone profile does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent availability zone profile.
@ -1156,7 +1156,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a availability zone profile
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the availability zone profile does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent availability zone profile.
@ -1232,7 +1232,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.load_balancer.v2.availability_zone.AvailabilityZone`
instance
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the availability zone does not exist.
When set to ``True``, no exception will be set when attempting to
delete a nonexistent availability zone.
@ -1250,7 +1250,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a availability zone
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised
:class:`~openstack.exceptions.NotFoundException` will be raised
when the availability zone does not exist.
When set to ``True``, no exception will be set when attempting
to delete a nonexistent availability zone.

View File

@ -45,7 +45,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.message.v2.queue.Queue` instance.
:returns: One :class:`~openstack.message.v2.queue.Queue`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
queue matching the name could be found.
"""
return self._get(_queue.Queue, queue)
@ -73,7 +73,7 @@ class Proxy(proxy.Proxy):
:param value: The value can be either the name of a queue or a
:class:`~openstack.message.v2.queue.Queue` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the queue does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent queue.
@ -127,7 +127,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.message.v2.message.Message` instance.
:returns: One :class:`~openstack.message.v2.message.Message`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
message matching the criteria could be found.
"""
message = self._get_resource(
@ -148,7 +148,7 @@ class Proxy(proxy.Proxy):
the claim seizing the message. If None, the message has
not been claimed.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the message does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent message.
@ -206,7 +206,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.message.v2.subscription.Subscription` instance.
:returns: One :class:`~openstack.message.v2.subscription.Subscription`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
subscription matching the criteria could be found.
"""
subscription = self._get_resource(
@ -223,7 +223,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.message.v2.subscription.Subscription`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the subscription does not exist.
When set to ``True``, no exception will be thrown when
attempting to delete a nonexistent subscription.
@ -260,7 +260,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.message.v2.claim.Claim` instance.
:returns: One :class:`~openstack.message.v2.claim.Claim`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
claim matching the criteria could be found.
"""
return self._get(_claim.Claim, claim, queue_name=queue_name)
@ -289,7 +289,7 @@ class Proxy(proxy.Proxy):
:param claim: The value can be either the ID of a claim or a
:class:`~openstack.message.v2.claim.Claim` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the claim does not exist.
When set to ``True``, no exception will be thrown when
attempting to delete a nonexistent claim.

File diff suppressed because it is too large Load Diff

View File

@ -157,7 +157,7 @@ class Proxy(proxy.Proxy):
:param container: The value can be either the name of a container or a
:class:`~openstack.object_store.v1.container.Container` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the container does not exist. When set to ``True``, no exception
will be set when attempting to delete a nonexistent server.
@ -174,7 +174,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.object_store.v1.container.Container` instance.
:returns: One :class:`~openstack.object_store.v1.container.Container`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._head(_container.Container, container)
@ -279,7 +279,7 @@ class Proxy(proxy.Proxy):
:returns: Instance of the
:class:`~openstack.object_store.v1.obj.Object` objects.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
container_name = self._get_container_name(obj=obj, container=container)
@ -323,7 +323,7 @@ class Proxy(proxy.Proxy):
:param container: The value can be the name of a container or a
:class:`~openstack.object_store.v1.container.Container` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
container_name = self._get_container_name(obj=obj, container=container)
@ -340,7 +340,7 @@ class Proxy(proxy.Proxy):
:param container: The value can be the name of a container or a
:class:`~openstack.object_store.v1.container.Container` instance.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
:returns: An iterator that iterates over chunk_size bytes
"""
@ -491,7 +491,7 @@ class Proxy(proxy.Proxy):
:param container: The value can be the ID of a container or a
:class:`~openstack.object_store.v1.container.Container` instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the object does not exist. When set to ``True``, no exception will
be set when attempting to delete a nonexistent server.
@ -515,7 +515,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.object_store.v1.container.Container` instance.
:returns: One :class:`~openstack.object_store.v1.obj.Object`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
container_name = self._get_container_name(obj, container)

View File

@ -75,7 +75,7 @@ class Info(resource.Resource):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_fetch` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
if not self.allow_fetch:

View File

@ -130,7 +130,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a stack.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -162,7 +162,7 @@ class Proxy(proxy.Proxy):
:param resolve_outputs: Whether stack should contain outputs resolved.
:returns: One :class:`~openstack.orchestration.v1.stack.Stack`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
return self._get(_stack.Stack, stack, resolve_outputs=resolve_outputs)
@ -177,7 +177,7 @@ class Proxy(proxy.Proxy):
:returns: The updated stack
:rtype: :class:`~openstack.orchestration.v1.stack.Stack`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
res = self._get_resource(_stack.Stack, stack, **attrs)
@ -190,7 +190,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.orchestration.v1.stack.Stack`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the stack does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent stack.
@ -232,7 +232,7 @@ class Proxy(proxy.Proxy):
:param stack: The value can be the ID or a name or
an instance of :class:`~openstack.orchestration.v1.stack.Stack`
:returns: A dictionary containing the stack data.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
if isinstance(stack, _stack.Stack):
@ -269,7 +269,7 @@ class Proxy(proxy.Proxy):
:returns: One object of
:class:`~openstack.orchestration.v1.stack_template.StackTemplate`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when no resource can be found.
"""
if isinstance(stack, _stack.Stack):
@ -292,7 +292,7 @@ class Proxy(proxy.Proxy):
:returns: One object of
:class:`~openstack.orchestration.v1.stack_environment.StackEnvironment`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
"""
if isinstance(stack, _stack.Stack):
@ -315,7 +315,7 @@ class Proxy(proxy.Proxy):
:returns: A dictionary containing the names and contents of all files
used by the stack.
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when the stack cannot be found.
"""
if isinstance(stack, _stack.Stack):
@ -339,7 +339,7 @@ class Proxy(proxy.Proxy):
an exception is thrown.
:rtype: A generator of
:class:`~openstack.orchestration.v1.resource.Resource`
:raises: :class:`~openstack.exceptions.ResourceNotFound`
:raises: :class:`~openstack.exceptions.NotFoundException`
when the stack cannot be found.
"""
# first try treat the value as a stack object or an ID
@ -395,7 +395,7 @@ class Proxy(proxy.Proxy):
config or an instance of
:class:`~openstack.orchestration.v1.software_config.SoftwareConfig`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the software config does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent software config.
@ -450,7 +450,7 @@ class Proxy(proxy.Proxy):
software deployment or an instance of
:class:`~openstack.orchestration.v1.software_deployment.SoftwareDeployment`
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the software deployment does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent software deployment.

View File

@ -242,7 +242,7 @@ class Stack(resource.Resource):
self._translate_response(response, **kwargs)
if self and self.status in ['DELETE_COMPLETE', 'ADOPT_COMPLETE']:
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
"No stack found for %s" % self.id
)
return self
@ -256,7 +256,7 @@ class Stack(resource.Resource):
:param name_or_id: This resource's identifier, if needed by
the request. The default is ``None``.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -269,7 +269,7 @@ class Stack(resource.Resource):
or None if nothing matches.
:raises: :class:`openstack.exceptions.DuplicateResource` if more
than one resource is found for this request.
:raises: :class:`openstack.exceptions.ResourceNotFound` if nothing
:raises: :class:`openstack.exceptions.NotFoundException` if nothing
is found and ignore_missing is ``False``.
"""
session = cls._get_session(session)
@ -287,7 +287,7 @@ class Stack(resource.Resource):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -48,7 +48,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.placement.v1.resource_class.ResourceClass`,
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource class does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
resource class.
@ -90,7 +90,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_class.ResourceClass`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource class matching the criteria could be found.
"""
return self._get(
@ -130,7 +130,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.placement.v1.resource_provider.ResourceProvider`,
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource provider does not exist. When set to ``True``, no
exception will be set when attempting to delete a nonexistent
resource provider.
@ -172,7 +172,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider.ResourceProvider`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource provider matching the criteria could be found.
"""
return self._get(
@ -185,13 +185,13 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a resource provider.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider.ResourceProvider`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource provider matching the criteria could be found.
"""
return self._find(
@ -223,7 +223,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider.ResourceProvider`
with the ``aggregates`` attribute populated.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource provider matching the criteria could be found.
"""
res = self._get_resource(
@ -245,7 +245,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider.ResourceProvider`
with the ``aggregates`` attribute populated with the updated value.
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource provider matching the criteria could be found.
"""
res = self._get_resource(
@ -305,7 +305,7 @@ class Proxy(proxy.Proxy):
instance. This value must be specified when
``resource_provider_inventory`` is an ID.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource provider inventory does not exist. When set to
``True``, no exception will be set when attempting to delete a
nonexistent resource provider inventory.
@ -379,7 +379,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource provider inventory matching the criteria could be found.
"""
resource_provider_id = self._get_uri_attribute(
@ -429,7 +429,7 @@ class Proxy(proxy.Proxy):
:param trait: The value can be either the ID of a trait or an
:class:`~openstack.placement.v1.trait.Trait`, instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource provider inventory does not exist. When set to
``True``, no exception will be set when attempting to delete a
nonexistent resource provider inventory.
@ -446,7 +446,7 @@ class Proxy(proxy.Proxy):
:returns: An instance of
:class:`~openstack.placement.v1.resource_provider_inventory.ResourceProviderInventory`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
trait matching the criteria could be found.
"""
return self._get(_trait.Trait, trait)

View File

@ -519,7 +519,7 @@ class Proxy(adapter.Adapter):
:param name_or_id: The name or ID of a resource to find.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -550,7 +550,7 @@ class Proxy(adapter.Adapter):
resource or a :class:`~openstack.resource.Resource`
subclass.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent resource.
@ -560,7 +560,7 @@ class Proxy(adapter.Adapter):
:raises: ``ValueError`` if ``value`` is a
:class:`~openstack.resource.Resource` that doesn't match
the ``resource_type``.
:class:`~openstack.exceptions.ResourceNotFound` when
:class:`~openstack.exceptions.NotFoundException` when
ignore_missing if ``False`` and a nonexistent resource
is attempted to be deleted.
"""
@ -568,7 +568,7 @@ class Proxy(adapter.Adapter):
try:
rv = res.delete(self)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
if ignore_missing:
return None
raise

View File

@ -1680,7 +1680,7 @@ class Resource(dict):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_fetch` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
if not self.allow_fetch:
@ -1721,7 +1721,7 @@ class Resource(dict):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_head` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if the resource
:raises: :exc:`~openstack.exceptions.NotFoundException` if the resource
was not found.
"""
if not self.allow_head:
@ -1952,7 +1952,7 @@ class Resource(dict):
:return: This :class:`Resource` instance.
:raises: :exc:`~openstack.exceptions.MethodNotSupported` if
:data:`Resource.allow_commit` is not set to ``True``.
:raises: :exc:`~openstack.exceptions.ResourceNotFound` if
:raises: :exc:`~openstack.exceptions.NotFoundException` if
the resource was not found.
"""
@ -2316,9 +2316,9 @@ class Resource(dict):
:param name_or_id: This resource's identifier, if needed by
the request. The default is ``None``.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:class:`~openstack.exceptions.NotFoundException` will be raised
when the resource does not exist. When set to ``True``, None will
be returned when attempting to find a nonexistent resource.
:param str list_base_path: base_path to be used when need listing
resources.
:param str microversion: API version to override the negotiated one.
@ -2331,8 +2331,8 @@ class Resource(dict):
or None if nothing matches.
:raises: :class:`openstack.exceptions.DuplicateResource` if more
than one resource is found for this request.
:raises: :class:`openstack.exceptions.ResourceNotFound` if nothing
is found and ignore_missing is ``False``.
:raises: :class:`openstack.exceptions.NotFoundException` if nothing is
found and ignore_missing is ``False``.
"""
session = cls._get_session(session)
@ -2377,7 +2377,7 @@ class Resource(dict):
if ignore_missing:
return None
raise exceptions.ResourceNotFound(
raise exceptions.NotFoundException(
f"No {cls.__name__} found for {name_or_id}"
)

View File

@ -124,7 +124,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a share.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -312,7 +312,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a share group.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.

View File

@ -93,7 +93,7 @@ class ShareAccessRule(resource.Resource):
try:
response = self._action(session, body, url)
self._translate_response(response)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
if not ignore_missing:
raise
return response

View File

@ -64,7 +64,7 @@ class TestBareMetalAllocation(Base):
self.conn.baremetal.delete_allocation(allocation, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_allocation,
allocation.id,
)
@ -113,12 +113,12 @@ class TestBareMetalAllocation(Base):
def test_allocation_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_allocation,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_allocation,
uuid,
ignore_missing=False,
@ -158,7 +158,7 @@ class TestBareMetalAllocationUpdate(Base):
self.conn.baremetal.delete_allocation(allocation, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_allocation,
allocation.id,
)
@ -203,7 +203,7 @@ class TestBareMetalAllocationUpdate(Base):
self.conn.baremetal.delete_allocation(allocation, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_allocation,
allocation.id,
)

View File

@ -24,7 +24,7 @@ class TestBareMetalChassis(base.BaseBaremetalTest):
self.conn.baremetal.delete_chassis(chassis, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_chassis,
chassis.id,
)
@ -53,16 +53,16 @@ class TestBareMetalChassis(base.BaseBaremetalTest):
def test_chassis_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound, self.conn.baremetal.get_chassis, uuid
exceptions.NotFoundException, self.conn.baremetal.get_chassis, uuid
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_chassis,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_chassis,
uuid,
ignore_missing=False,

View File

@ -40,7 +40,7 @@ class TestBareMetalDeployTemplate(base.BaseBaremetalTest):
deploy_template, ignore_missing=False
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_deploy_template,
deploy_template.id,
)
@ -165,12 +165,12 @@ class TestBareMetalDeployTemplate(base.BaseBaremetalTest):
def test_deploy_template_negative_non_existing(self):
uuid = "bbb45f41-d4bc-4307-8d1d-32f95ce1e920"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_deploy_template,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_deploy_template,
uuid,
ignore_missing=False,

View File

@ -27,7 +27,7 @@ class TestBareMetalDriver(base.BaseBaremetalTest):
def test_driver_negative_non_existing(self):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_driver,
'not-a-driver',
)

View File

@ -50,7 +50,7 @@ class TestBareMetalNode(base.BaseBaremetalTest):
self.conn.baremetal.delete_node(node, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_node,
self.node_id,
)
@ -63,7 +63,7 @@ class TestBareMetalNode(base.BaseBaremetalTest):
self.conn.baremetal.delete_node(node, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_node,
self.node_id,
)
@ -223,22 +223,22 @@ class TestBareMetalNode(base.BaseBaremetalTest):
def test_node_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound, self.conn.baremetal.get_node, uuid
exceptions.NotFoundException, self.conn.baremetal.get_node, uuid
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_node,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_node,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.update_node,
uuid,
name='new-name',
@ -422,18 +422,18 @@ class TestBareMetalVif(base.BaseBaremetalTest):
def test_node_vif_negative(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.attach_vif_to_node,
uuid,
self.vif_id,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.list_node_vifs,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.detach_vif_from_node,
uuid,
self.vif_id,

View File

@ -40,7 +40,7 @@ class TestBareMetalPort(base.BaseBaremetalTest):
self.conn.baremetal.delete_port(port, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound, self.conn.baremetal.get_port, port.id
exceptions.NotFoundException, self.conn.baremetal.get_port, port.id
)
def test_port_list(self):
@ -107,22 +107,22 @@ class TestBareMetalPort(base.BaseBaremetalTest):
def test_port_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound, self.conn.baremetal.get_port, uuid
exceptions.NotFoundException, self.conn.baremetal.get_port, uuid
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_port,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_port,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.update_port,
uuid,
pxe_enabled=True,

View File

@ -37,7 +37,7 @@ class TestBareMetalPortGroup(base.BaseBaremetalTest):
self.conn.baremetal.delete_port_group(port_group, ignore_missing=False)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_port_group,
port_group.id,
)
@ -100,18 +100,18 @@ class TestBareMetalPortGroup(base.BaseBaremetalTest):
def test_port_group_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_port_group,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_port_group,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_port_group,
uuid,
ignore_missing=False,

View File

@ -45,7 +45,7 @@ class TestBareMetalVolumeconnector(base.BaseBaremetalTest):
volume_connector, ignore_missing=False
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_volume_connector,
volume_connector.id,
)
@ -152,18 +152,18 @@ class TestBareMetalVolumeconnector(base.BaseBaremetalTest):
def test_volume_connector_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_volume_connector,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_volume_connector,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_volume_connector,
uuid,
ignore_missing=False,

View File

@ -47,7 +47,7 @@ class TestBareMetalVolumetarget(base.BaseBaremetalTest):
volume_target, ignore_missing=False
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_volume_target,
volume_target.id,
)
@ -166,18 +166,18 @@ class TestBareMetalVolumetarget(base.BaseBaremetalTest):
def test_volume_target_negative_non_existing(self):
uuid = "5c9dcd04-2073-49bc-9618-99ae634d8971"
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.get_volume_target,
uuid,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.find_volume_target,
uuid,
ignore_missing=False,
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.baremetal.delete_volume_target,
uuid,
ignore_missing=False,

View File

@ -48,7 +48,7 @@ class TestFlavor(base.BaseFunctionalTest):
def test_find_flavors_no_match_ignore_false(self):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.conn.compute.find_flavor,
"not a flavor",
ignore_missing=False,

View File

@ -123,7 +123,7 @@ class TestZoneShare(base.BaseFunctionalTest):
def test_find_zone_share_ignore_missing_false(self):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.operator_cloud.dns.find_zone_share,
self.zone,
'bogus_id',

View File

@ -72,7 +72,7 @@ class TestStack(base.BaseFunctionalTest):
self.conn.orchestration.wait_for_status(
self.stack, 'DELETE_COMPLETE', wait=self._wait_for_timeout
)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
pass
test_network.delete_network(self.conn, self.network, self.subnet)
super().tearDown()

View File

@ -192,7 +192,7 @@ class ManageUnmanageShareTest(base.BaseSharedFileSystemTest):
try:
self.operator_cloud.share.get_share(self.SHARE_ID)
except exceptions.ResourceNotFound:
except exceptions.NotFoundException:
pass
managed_share = self.operator_cloud.share.manage_share(

View File

@ -66,7 +66,7 @@ class TestNovaExtensions(base.TestCase):
]
)
self.assertRaises(
exceptions.ResourceNotFound, self.cloud._nova_extensions
exceptions.NotFoundException, self.cloud._nova_extensions
)
self.assert_calls()

View File

@ -235,7 +235,7 @@ class TestDomains(base.TestCase):
),
]
)
with testtools.ExpectedException(exceptions.ResourceNotFound):
with testtools.ExpectedException(exceptions.NotFoundException):
self.cloud.delete_domain(domain_data.domain_id)
self.assert_calls()

View File

@ -444,7 +444,7 @@ class TestFirewallPolicy(FirewallTestCase):
with mock.patch.object(self.cloud.network, 'create_firewall_policy'):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.cloud.create_firewall_policy,
**posted_policy
)
@ -947,7 +947,7 @@ class TestFirewallPolicy(FirewallTestCase):
with mock.patch.object(self.cloud.network, 'find_firewall_rule'):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.cloud.insert_rule_into_policy,
policy_name,
'bogus_rule',
@ -979,7 +979,7 @@ class TestFirewallPolicy(FirewallTestCase):
]
)
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.cloud.insert_rule_into_policy,
self.firewall_policy_id,
rule_name,
@ -1088,7 +1088,7 @@ class TestFirewallPolicy(FirewallTestCase):
with mock.patch.object(self.cloud.network, 'find_firewall_rule'):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.cloud.remove_rule_from_policy,
self.firewall_policy_name,
TestFirewallRule.firewall_rule_name,

View File

@ -66,7 +66,7 @@ class TestNeutronExtensions(base.TestCase):
)
]
)
with testtools.ExpectedException(exceptions.ResourceNotFound):
with testtools.ExpectedException(exceptions.NotFoundException):
self.cloud._neutron_extensions()
self.assert_calls()

View File

@ -64,7 +64,7 @@ class TestSearch(base.TestCase):
)
def test_search_resources_list(self):
self.session._get.side_effect = exceptions.ResourceNotFound
self.session._get.side_effect = exceptions.NotFoundException
self.session._list.return_value = [self.FakeResource(foo="bar")]
ret = self.cloud.search_resources("mock_session.fake", "fake_name")
@ -79,7 +79,7 @@ class TestSearch(base.TestCase):
)
def test_search_resources_args(self):
self.session._get.side_effect = exceptions.ResourceNotFound
self.session._get.side_effect = exceptions.NotFoundException
self.session._list.return_value = []
self.cloud.search_resources(

View File

@ -127,7 +127,7 @@ class TestService(base.TestCase):
list_mock.return_value = data
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
service.Service.find,
self.sess,
'fake',

View File

@ -78,7 +78,7 @@ class TestTrunk(base.TestCase):
'segmentation_type': 'vlan',
}
]
with testtools.ExpectedException(exceptions.ResourceNotFound, msg):
with testtools.ExpectedException(exceptions.NotFoundException, msg):
sot.add_subports(sess, subports)
def test_delete_subports_4xx(self):
@ -100,5 +100,5 @@ class TestTrunk(base.TestCase):
'segmentation_type': 'vlan',
}
]
with testtools.ExpectedException(exceptions.ResourceNotFound, msg):
with testtools.ExpectedException(exceptions.NotFoundException, msg):
sot.delete_subports(sess, subports)

View File

@ -348,12 +348,12 @@ class TestOrchestrationResource(TestOrchestrationProxy):
@mock.patch.object(resource.Resource, 'list')
def test_resources_stack_not_found(self, mock_list, mock_find):
stack_name = 'test_stack'
mock_find.side_effect = exceptions.ResourceNotFound(
mock_find.side_effect = exceptions.NotFoundException(
'No stack found for test_stack'
)
ex = self.assertRaises(
exceptions.ResourceNotFound, self.proxy.resources, stack_name
exceptions.NotFoundException, self.proxy.resources, stack_name
)
self.assertEqual('No stack found for test_stack', str(ex))

View File

@ -230,7 +230,7 @@ class TestStack(base.TestCase):
test_resource.FakeResponse(
{'stack': {'stack_status': 'CREATE_COMPLETE'}}, 200
),
exceptions.ResourceNotFound(message='oops'),
exceptions.NotFoundException(message='oops'),
test_resource.FakeResponse(
{'stack': {'stack_status': 'DELETE_COMPLETE'}}, 200
),
@ -248,9 +248,9 @@ class TestStack(base.TestCase):
microversion=None,
skip_cache=False,
)
ex = self.assertRaises(exceptions.ResourceNotFound, sot.fetch, sess)
ex = self.assertRaises(exceptions.NotFoundException, sot.fetch, sess)
self.assertEqual('oops', str(ex))
ex = self.assertRaises(exceptions.ResourceNotFound, sot.fetch, sess)
ex = self.assertRaises(exceptions.NotFoundException, sot.fetch, sess)
self.assertEqual('No stack found for %s' % FAKE_ID, str(ex))
def test_abandon(self):

View File

@ -236,7 +236,7 @@ class TestProxyDelete(base.TestCase):
self.assertEqual(rv, self.fake_id)
def test_delete_ignore_missing(self):
self.res.delete.side_effect = exceptions.ResourceNotFound(
self.res.delete.side_effect = exceptions.NotFoundException(
message="test", http_status=404
)
@ -244,12 +244,12 @@ class TestProxyDelete(base.TestCase):
self.assertIsNone(rv)
def test_delete_NotFound(self):
self.res.delete.side_effect = exceptions.ResourceNotFound(
self.res.delete.side_effect = exceptions.NotFoundException(
message="test", http_status=404
)
self.assertRaisesRegex(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
# TODO(shade) The mocks here are hiding the thing we want to test.
"test",
self.sot._delete,
@ -467,12 +467,12 @@ class TestProxyGet(base.TestCase):
self.assertEqual(rv, self.fake_result)
def test_get_not_found(self):
self.res.fetch.side_effect = exceptions.ResourceNotFound(
self.res.fetch.side_effect = exceptions.NotFoundException(
message="test", http_status=404
)
self.assertRaisesRegex(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
"test",
self.sot._get,
RetrieveableResource,

View File

@ -3302,7 +3302,7 @@ class TestResourceFind(base.TestCase):
def existing(cls, **kwargs):
response = mock.Mock()
response.status_code = 404
raise exceptions.ResourceNotFound('Not Found', response=response)
raise exceptions.NotFoundException('Not Found', response=response)
@classmethod
def list(cls, session, **params):
@ -3343,7 +3343,7 @@ class TestResourceFind(base.TestCase):
def test_no_match_raise(self):
self.assertRaises(
exceptions.ResourceNotFound,
exceptions.NotFoundException,
self.no_results.find,
self.cloud.compute,
"name",
@ -3736,7 +3736,7 @@ class TestWaitForDelete(TestWait):
res.fetch.side_effect = [
res,
res,
exceptions.ResourceNotFound('Not Found', response),
exceptions.NotFoundException('Not Found', response),
]
result = resource.wait_for_delete(self.cloud.compute, res, 1, 3)

View File

@ -56,7 +56,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.workflow.Workflow` instance.
:returns: One :class:`~openstack.workflow.v2.workflow.Workflow`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
workflow matching the name could be found.
"""
return self._get(_workflow.Workflow, *attrs)
@ -86,7 +86,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.workflow.Workflow`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will
:class:`~openstack.exceptions.NotFoundException` will
be raised when the workflow does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent workflow.
@ -102,7 +102,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of an workflow.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -134,7 +134,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.execution.Execution` instance.
:returns: One :class:`~openstack.workflow.v2.execution.Execution`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
execution matching the criteria could be found.
"""
return self._get(_execution.Execution, *attrs)
@ -164,7 +164,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.execute.Execution`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the execution does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent execution.
@ -180,7 +180,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of an execution.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the resource does not exist.
When set to ``True``, None will be returned when
attempting to find a nonexistent resource.
@ -210,7 +210,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.cron_trigger.CronTrigger` instance.
:returns: One :class:`~openstack.workflow.v2.cron_trigger.CronTrigger`
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
cron triggers matching the criteria could be found.
"""
return self._get(_cron_trigger.CronTrigger, cron_trigger)
@ -244,7 +244,7 @@ class Proxy(proxy.Proxy):
:class:`~openstack.workflow.v2.cron_trigger.CronTrigger`
instance.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be
:class:`~openstack.exceptions.NotFoundException` will be
raised when the cron trigger does not exist.
When set to ``True``, no exception will be set when
attempting to delete a nonexistent cron trigger.
@ -268,7 +268,7 @@ class Proxy(proxy.Proxy):
:param name_or_id: The name or ID of a cron trigger.
:param bool ignore_missing: When set to ``False``
:class:`~openstack.exceptions.ResourceNotFound` will be raised when
:class:`~openstack.exceptions.NotFoundException` will be raised when
the resource does not exist. When set to ``True``, None will be
returned when attempting to find a nonexistent resource.
:param bool all_projects: When set to ``True``, search for cron
@ -279,7 +279,7 @@ class Proxy(proxy.Proxy):
:returns: One :class:`~openstack.compute.v2.cron_trigger.CronTrigger`
or None
:raises: :class:`~openstack.exceptions.ResourceNotFound` when no
:raises: :class:`~openstack.exceptions.NotFoundException` when no
resource can be found.
:raises: :class:`~openstack.exceptions.DuplicateResource` when multiple
resources are found.