baremetal-introspection: fix passing a Node to start_introspection
Currently only a string ID is supported despite what the docstring claims. Change-Id: I59f8f85a31395c8a096cd507421cebb36d18198d
This commit is contained in:
parent
ca780d3bb8
commit
4a6b5beb77
@ -11,6 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
from openstack import _log
|
||||
from openstack.baremetal.v1 import node as _node
|
||||
from openstack.baremetal_introspection.v1 import introspection as _introspect
|
||||
from openstack import exceptions
|
||||
from openstack import proxy
|
||||
@ -63,7 +64,8 @@ class Proxy(proxy.Proxy):
|
||||
|
||||
:returns: :class:`~.introspection.Introspection` instance.
|
||||
"""
|
||||
return self._create(_introspect.Introspection, id=node)
|
||||
node = self._get_resource(_node.Node, node)
|
||||
return self._create(_introspect.Introspection, id=node.id)
|
||||
|
||||
def get_introspection(self, introspection):
|
||||
"""Get a specific introspection.
|
||||
|
@ -14,6 +14,7 @@ import mock
|
||||
|
||||
from keystoneauth1 import adapter
|
||||
|
||||
from openstack.baremetal.v1 import node as _node
|
||||
from openstack.baremetal_introspection.v1 import _proxy
|
||||
from openstack.baremetal_introspection.v1 import introspection
|
||||
from openstack import exceptions
|
||||
@ -33,6 +34,12 @@ class TestBaremetalIntrospectionProxy(test_proxy_base.TestProxyBase):
|
||||
method_kwargs={'node': 'abcd'},
|
||||
expected_kwargs={'id': 'abcd'})
|
||||
|
||||
def test_create_introspection_with_node(self):
|
||||
self.verify_create(self.proxy.start_introspection,
|
||||
introspection.Introspection,
|
||||
method_kwargs={'node': _node.Node(id='abcd')},
|
||||
expected_kwargs={'id': 'abcd'})
|
||||
|
||||
def test_get_introspection(self):
|
||||
self.verify_get(self.proxy.get_introspection,
|
||||
introspection.Introspection)
|
||||
|
@ -0,0 +1,4 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes using a full `Node` object as an argument to `start_introspection`.
|
Loading…
x
Reference in New Issue
Block a user