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(