Skip to content

Commit e49a632

Browse files
committed
proxy update database changes
Change-Id: Ia11b3fe8907923f3361b7c43babab52e98707b24
1 parent 339808b commit e49a632

2 files changed

Lines changed: 24 additions & 7 deletions

File tree

openstack/database/v1/_proxy.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def delete_database(self, value, ignore_missing=True):
3131
:class:`~openstack.exceptions.ResourceNotFound` will be
3232
raised when the database does not exist.
3333
When set to ``True``, no exception will be set when
34-
attempting to delete a nonexistent server.
34+
attempting to delete a nonexistent database.
3535
3636
:returns: ``None``
3737
"""
@@ -64,7 +64,7 @@ def delete_instance(self, value, ignore_missing=True):
6464
:class:`~openstack.exceptions.ResourceNotFound` will be
6565
raised when the instance does not exist.
6666
When set to ``True``, no exception will be set when
67-
attempting to delete a nonexistent server.
67+
attempting to delete a nonexistent instance.
6868
6969
:returns: ``None``
7070
"""
@@ -79,8 +79,19 @@ def get_instance(self, **data):
7979
def list_instance(self):
8080
return instance.Instance.list(self.session)
8181

82-
def update_instance(self, **data):
83-
return instance.Instance(data).update(self.session)
82+
def update_instance(self, value, **attrs):
83+
"""Update a instance
84+
85+
:param value: Either the id of a instance or a
86+
:class:`~openstack.compute.v2.instance.Instance`
87+
instance.
88+
:attrs kwargs: The attributes to update on the instance represented
89+
by ``value``.
90+
91+
:returns: The updated instance
92+
:rtype: :class:`~openstack.compute.v2.instance.Instance`
93+
"""
94+
return self._update(instance.Instance, value, **attrs)
8495

8596
def create_user(self, **data):
8697
return user.User(data).create(self.session)
@@ -94,7 +105,7 @@ def delete_user(self, value, ignore_missing=True):
94105
:class:`~openstack.exceptions.ResourceNotFound` will be
95106
raised when the user does not exist.
96107
When set to ``True``, no exception will be set when
97-
attempting to delete a nonexistent server.
108+
attempting to delete a nonexistent user.
98109
99110
:returns: ``None``
100111
"""

openstack/tests/unit/database/v1/test_proxy.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,14 @@ def test_instance_list(self):
7979
self.proxy.list_instance)
8080

8181
def test_instance_update(self):
82-
self.verify_update('openstack.database.v1.instance.Instance.update',
83-
self.proxy.update_instance)
82+
kwargs = {"x": 1, "y": 2, "z": 3}
83+
self.verify_update2('openstack.proxy.BaseProxy._update',
84+
self.proxy.update_instance,
85+
method_args=["resource_or_id"],
86+
method_kwargs=kwargs,
87+
expected_args=[instance.Instance,
88+
"resource_or_id"],
89+
expected_kwargs=kwargs)
8490

8591
def test_user_create(self):
8692
self.verify_create('openstack.database.v1.user.User.create',

0 commit comments

Comments
 (0)