Fix parameter name clashing in resource lock query
TODO: * add test coverage * look at other methods taking resource_type as kwargs Closes-Bug: #2075347 Change-Id: I2a48a3793ebd2db9dd9ca02b75b599c266ad1c24
This commit is contained in:
parent
939ec03ab3
commit
ef052e4880
@ -744,6 +744,14 @@ class Proxy(adapter.Adapter):
|
|||||||
:class:`~openstack.resource.Resource` that doesn't match
|
:class:`~openstack.resource.Resource` that doesn't match
|
||||||
the ``resource_type``.
|
the ``resource_type``.
|
||||||
"""
|
"""
|
||||||
|
# Check for attributes whose names conflict with the parameters
|
||||||
|
# specified in the method.
|
||||||
|
conflicting_attrs = attrs.get('__conflicting_attrs', {})
|
||||||
|
if conflicting_attrs:
|
||||||
|
for k, v in conflicting_attrs.items():
|
||||||
|
attrs[k] = v
|
||||||
|
attrs.pop('__conflicting_attrs')
|
||||||
|
|
||||||
data = resource_type.list(
|
data = resource_type.list(
|
||||||
self, paginated=paginated, base_path=base_path, **attrs
|
self, paginated=paginated, base_path=base_path, **attrs
|
||||||
)
|
)
|
||||||
|
@ -1129,6 +1129,15 @@ class Proxy(proxy.Proxy):
|
|||||||
:rtype: :class:`~openstack.shared_file_system.v2.
|
:rtype: :class:`~openstack.shared_file_system.v2.
|
||||||
resource_locks.ResourceLock`
|
resource_locks.ResourceLock`
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if query.get('resource_type'):
|
||||||
|
# The _create method has a parameter named resource_type, which
|
||||||
|
# refers to the type of resource to be created, so we need to avoid
|
||||||
|
# a conflict of parameters we are sending to the method.
|
||||||
|
query['__conflicting_attrs'] = {
|
||||||
|
'resource_type': query.get('resource_type')
|
||||||
|
}
|
||||||
|
query.pop('resource_type')
|
||||||
return self._list(_resource_locks.ResourceLock, **query)
|
return self._list(_resource_locks.ResourceLock, **query)
|
||||||
|
|
||||||
def get_resource_lock(self, resource_lock):
|
def get_resource_lock(self, resource_lock):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user