Revert "Add 'details' parameter to various 'find' proxy methods"
This partially reverts commit f9a3cc2f135e5c28fa1e046bb1ca034be36be9aa. Reason for revert: The change to the baremetal functions is not working, this part of the original change is reverted here. Change-Id: Icc70bbdc06b5f32722a93775aee2da4d7b7ca4ae
This commit is contained in:
parent
f9a3cc2f13
commit
6a0fd31a03
openstack
releasenotes/notes
@ -112,7 +112,7 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_chassis.Chassis, **attrs)
|
return self._create(_chassis.Chassis, **attrs)
|
||||||
|
|
||||||
def find_chassis(self, name_or_id, ignore_missing=True, *, details=True):
|
def find_chassis(self, name_or_id, ignore_missing=True):
|
||||||
"""Find a single chassis.
|
"""Find a single chassis.
|
||||||
|
|
||||||
:param str name_or_id: The ID of a chassis.
|
:param str name_or_id: The ID of a chassis.
|
||||||
@ -120,19 +120,11 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
||||||
when the chassis does not exist. When set to `True``, None will
|
when the chassis does not exist. When set to `True``, None will
|
||||||
be returned when attempting to find a nonexistent chassis.
|
be returned when attempting to find a nonexistent chassis.
|
||||||
:param details: A boolean indicating whether the detailed information
|
|
||||||
for the chassis should be returned.
|
|
||||||
|
|
||||||
:returns: One :class:`~openstack.baremetal.v1.chassis.Chassis` object
|
:returns: One :class:`~openstack.baremetal.v1.chassis.Chassis` object
|
||||||
or None.
|
or None.
|
||||||
"""
|
"""
|
||||||
list_base_path = '/chassis/detail' if details else None
|
return self._find(_chassis.Chassis, name_or_id,
|
||||||
return self._find(
|
ignore_missing=ignore_missing)
|
||||||
_chassis.Chassis,
|
|
||||||
name_or_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
list_base_path=list_base_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_chassis(self, chassis, fields=None):
|
def get_chassis(self, chassis, fields=None):
|
||||||
"""Get a specific chassis.
|
"""Get a specific chassis.
|
||||||
@ -308,7 +300,7 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_node.Node, **attrs)
|
return self._create(_node.Node, **attrs)
|
||||||
|
|
||||||
def find_node(self, name_or_id, ignore_missing=True, *, details=True):
|
def find_node(self, name_or_id, ignore_missing=True):
|
||||||
"""Find a single node.
|
"""Find a single node.
|
||||||
|
|
||||||
:param str name_or_id: The name or ID of a node.
|
:param str name_or_id: The name or ID of a node.
|
||||||
@ -316,18 +308,11 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
||||||
when the node does not exist. When set to `True``, None will
|
when the node does not exist. When set to `True``, None will
|
||||||
be returned when attempting to find a nonexistent node.
|
be returned when attempting to find a nonexistent node.
|
||||||
:param details: A boolean indicating whether the detailed information
|
|
||||||
for the node should be returned.
|
|
||||||
:returns: One :class:`~openstack.baremetal.v1.node.Node` object
|
:returns: One :class:`~openstack.baremetal.v1.node.Node` object
|
||||||
or None.
|
or None.
|
||||||
"""
|
"""
|
||||||
list_base_path = '/nodes/detail' if details else None
|
return self._find(_node.Node, name_or_id,
|
||||||
return self._find(
|
ignore_missing=ignore_missing)
|
||||||
_node.Node,
|
|
||||||
name_or_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
list_base_path=list_base_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_node(self, node, fields=None):
|
def get_node(self, node, fields=None):
|
||||||
"""Get a specific node.
|
"""Get a specific node.
|
||||||
@ -700,7 +685,7 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_port.Port, **attrs)
|
return self._create(_port.Port, **attrs)
|
||||||
|
|
||||||
def find_port(self, name_or_id, ignore_missing=True, *, details=True):
|
def find_port(self, name_or_id, ignore_missing=True):
|
||||||
"""Find a single port.
|
"""Find a single port.
|
||||||
|
|
||||||
:param str name_or_id: The ID of a port.
|
:param str name_or_id: The ID of a port.
|
||||||
@ -708,18 +693,11 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
||||||
when the port does not exist. When set to `True``, None will
|
when the port does not exist. When set to `True``, None will
|
||||||
be returned when attempting to find a nonexistent port.
|
be returned when attempting to find a nonexistent port.
|
||||||
:param details: A boolean indicating whether the detailed information
|
|
||||||
for every port should be returned.
|
|
||||||
:returns: One :class:`~openstack.baremetal.v1.port.Port` object
|
:returns: One :class:`~openstack.baremetal.v1.port.Port` object
|
||||||
or None.
|
or None.
|
||||||
"""
|
"""
|
||||||
list_base_path = '/ports/detail' if details else None
|
return self._find(_port.Port, name_or_id,
|
||||||
return self._find(
|
ignore_missing=ignore_missing)
|
||||||
_port.Port,
|
|
||||||
name_or_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
list_base_path=list_base_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_port(self, port, fields=None):
|
def get_port(self, port, fields=None):
|
||||||
"""Get a specific port.
|
"""Get a specific port.
|
||||||
@ -825,13 +803,7 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_portgroup.PortGroup, **attrs)
|
return self._create(_portgroup.PortGroup, **attrs)
|
||||||
|
|
||||||
def find_port_group(
|
def find_port_group(self, name_or_id, ignore_missing=True):
|
||||||
self,
|
|
||||||
name_or_id,
|
|
||||||
ignore_missing=True,
|
|
||||||
*,
|
|
||||||
details=True,
|
|
||||||
):
|
|
||||||
"""Find a single port group.
|
"""Find a single port group.
|
||||||
|
|
||||||
:param str name_or_id: The name or ID of a portgroup.
|
:param str name_or_id: The name or ID of a portgroup.
|
||||||
@ -839,18 +811,11 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
:class:`~openstack.exceptions.ResourceNotFound` will be raised
|
||||||
when the port group does not exist. When set to `True``, None will
|
when the port group does not exist. When set to `True``, None will
|
||||||
be returned when attempting to find a nonexistent port group.
|
be returned when attempting to find a nonexistent port group.
|
||||||
:param details: A boolean indicating whether the detailed information
|
|
||||||
for the port group should be returned.
|
|
||||||
:returns: One :class:`~openstack.baremetal.v1.port_group.PortGroup`
|
:returns: One :class:`~openstack.baremetal.v1.port_group.PortGroup`
|
||||||
object or None.
|
object or None.
|
||||||
"""
|
"""
|
||||||
list_base_path = '/portgroups/detail' if details else None
|
return self._find(_portgroup.PortGroup, name_or_id,
|
||||||
return self._find(
|
ignore_missing=ignore_missing)
|
||||||
_portgroup.PortGroup,
|
|
||||||
name_or_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
list_base_path=list_base_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_port_group(self, port_group, fields=None):
|
def get_port_group(self, port_group, fields=None):
|
||||||
"""Get a specific port group.
|
"""Get a specific port group.
|
||||||
@ -1204,8 +1169,6 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_volumeconnector.VolumeConnector, **attrs)
|
return self._create(_volumeconnector.VolumeConnector, **attrs)
|
||||||
|
|
||||||
# TODO(stephenfin): Delete this. You can't lookup a volume connector by
|
|
||||||
# name so this is identical to get_volume_connector
|
|
||||||
def find_volume_connector(self, vc_id, ignore_missing=True):
|
def find_volume_connector(self, vc_id, ignore_missing=True):
|
||||||
"""Find a single volume connector.
|
"""Find a single volume connector.
|
||||||
|
|
||||||
@ -1220,11 +1183,8 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.baremetal.v1.volumeconnector.VolumeConnector`
|
:class:`~openstack.baremetal.v1.volumeconnector.VolumeConnector`
|
||||||
object or None.
|
object or None.
|
||||||
"""
|
"""
|
||||||
return self._find(
|
return self._find(_volumeconnector.VolumeConnector, vc_id,
|
||||||
_volumeconnector.VolumeConnector,
|
ignore_missing=ignore_missing)
|
||||||
vc_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_volume_connector(self, volume_connector, fields=None):
|
def get_volume_connector(self, volume_connector, fields=None):
|
||||||
"""Get a specific volume_connector.
|
"""Get a specific volume_connector.
|
||||||
@ -1349,8 +1309,6 @@ class Proxy(proxy.Proxy):
|
|||||||
"""
|
"""
|
||||||
return self._create(_volumetarget.VolumeTarget, **attrs)
|
return self._create(_volumetarget.VolumeTarget, **attrs)
|
||||||
|
|
||||||
# TODO(stephenfin): Delete this. You can't lookup a volume target by
|
|
||||||
# name so this is identical to get_volume_connector
|
|
||||||
def find_volume_target(self, vt_id, ignore_missing=True):
|
def find_volume_target(self, vt_id, ignore_missing=True):
|
||||||
"""Find a single volume target.
|
"""Find a single volume target.
|
||||||
|
|
||||||
@ -1365,11 +1323,8 @@ class Proxy(proxy.Proxy):
|
|||||||
:class:`~openstack.baremetal.v1.volumetarget.VolumeTarget`
|
:class:`~openstack.baremetal.v1.volumetarget.VolumeTarget`
|
||||||
object or None.
|
object or None.
|
||||||
"""
|
"""
|
||||||
return self._find(
|
return self._find(_volumetarget.VolumeTarget, vt_id,
|
||||||
_volumetarget.VolumeTarget,
|
ignore_missing=ignore_missing)
|
||||||
vt_id,
|
|
||||||
ignore_missing=ignore_missing,
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_volume_target(self, volume_target, fields=None):
|
def get_volume_target(self, volume_target, fields=None):
|
||||||
"""Get a specific volume_target.
|
"""Get a specific volume_target.
|
||||||
|
@ -60,11 +60,7 @@ class TestChassis(TestBaremetalProxy):
|
|||||||
self.verify_create(self.proxy.create_chassis, chassis.Chassis)
|
self.verify_create(self.proxy.create_chassis, chassis.Chassis)
|
||||||
|
|
||||||
def test_find_chassis(self):
|
def test_find_chassis(self):
|
||||||
self.verify_find(
|
self.verify_find(self.proxy.find_chassis, chassis.Chassis)
|
||||||
self.proxy.find_chassis,
|
|
||||||
chassis.Chassis,
|
|
||||||
expected_kwargs={'list_base_path': '/chassis/detail'},
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_get_chassis(self):
|
def test_get_chassis(self):
|
||||||
self.verify_get(self.proxy.get_chassis, chassis.Chassis,
|
self.verify_get(self.proxy.get_chassis, chassis.Chassis,
|
||||||
@ -98,11 +94,7 @@ class TestNode(TestBaremetalProxy):
|
|||||||
self.verify_create(self.proxy.create_node, node.Node)
|
self.verify_create(self.proxy.create_node, node.Node)
|
||||||
|
|
||||||
def test_find_node(self):
|
def test_find_node(self):
|
||||||
self.verify_find(
|
self.verify_find(self.proxy.find_node, node.Node)
|
||||||
self.proxy.find_node,
|
|
||||||
node.Node,
|
|
||||||
expected_kwargs={'list_base_path': '/nodes/detail'},
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_get_node(self):
|
def test_get_node(self):
|
||||||
self.verify_get(self.proxy.get_node, node.Node,
|
self.verify_get(self.proxy.get_node, node.Node,
|
||||||
@ -148,11 +140,7 @@ class TestPort(TestBaremetalProxy):
|
|||||||
self.verify_create(self.proxy.create_port, port.Port)
|
self.verify_create(self.proxy.create_port, port.Port)
|
||||||
|
|
||||||
def test_find_port(self):
|
def test_find_port(self):
|
||||||
self.verify_find(
|
self.verify_find(self.proxy.find_port, port.Port)
|
||||||
self.proxy.find_port,
|
|
||||||
port.Port,
|
|
||||||
expected_kwargs={'list_base_path': '/ports/detail'},
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_get_port(self):
|
def test_get_port(self):
|
||||||
self.verify_get(self.proxy.get_port, port.Port,
|
self.verify_get(self.proxy.get_port, port.Port,
|
||||||
|
@ -4,13 +4,6 @@ features:
|
|||||||
The following proxy ``find_*`` operations will now retrieve a detailed
|
The following proxy ``find_*`` operations will now retrieve a detailed
|
||||||
resource by default when retrieving by name:
|
resource by default when retrieving by name:
|
||||||
|
|
||||||
* Bare metal (v1)
|
|
||||||
|
|
||||||
* ``find_chassis``
|
|
||||||
* ``find_node``
|
|
||||||
* ``find_port``
|
|
||||||
* ``find_port_group``
|
|
||||||
|
|
||||||
* Block storage (v2)
|
* Block storage (v2)
|
||||||
|
|
||||||
* ``find_volume``
|
* ``find_volume``
|
||||||
|
Loading…
x
Reference in New Issue
Block a user