Update method improved
The base method from oslo is slightly improved to handle the id and wrapping correctly. Change-Id: I35e62c76498040c8e7180df400c278dfa766bb70
This commit is contained in:
parent
2090a8beff
commit
a5c1b220ac
@ -104,9 +104,21 @@ class BaseManager(base.CrudManager):
|
||||
"""
|
||||
|
||||
kwargs = self._filter_kwargs(kwargs)
|
||||
return self._post(
|
||||
self.build_url(**kwargs),
|
||||
kwargs)
|
||||
return self._post(self.build_url(**kwargs), kwargs)
|
||||
|
||||
def update(self, **kwargs):
|
||||
"""Update a resource.
|
||||
|
||||
The default implementation is overridden so that the dictionary is
|
||||
passed 'as is' without any wrapping. The id field is removed from the
|
||||
request body.
|
||||
"""
|
||||
|
||||
kwargs = self._filter_kwargs(kwargs)
|
||||
params = kwargs.copy()
|
||||
params.pop('id')
|
||||
|
||||
return self._put(self.build_url(**kwargs), params)
|
||||
|
||||
|
||||
class BaseNestedManager(BaseManager):
|
||||
|
Loading…
x
Reference in New Issue
Block a user