Skip to content
Browse files

Merge "Additional "Unify Manager._update behaviour" cleanup"

  • Loading branch information...
2 parents 82704d4 + f73df49 commit 219f1dfb5a24e60fa1d700fd42348261472deb40 Jenkins committed with openstack-gerrit
Showing with 6 additions and 5 deletions.
  1. +5 −4 novaclient/base.py
  2. +1 −1 tests/v1_1/test_floating_ips_bulk.py
View
9 novaclient/base.py
@@ -156,10 +156,11 @@ def _delete(self, url):
def _update(self, url, body, response_key=None, **kwargs):
self.run_hooks('modify_body_for_update', body, **kwargs)
_resp, body = self.api.client.put(url, body=body)
- if response_key:
- return self.resource_class(self, body[response_key])
- else:
- return body
+ if body:
+ if response_key:
+ return self.resource_class(self, body[response_key])
+ else:
+ return self.resource_class(self, body)
class ManagerWithFind(Manager):
View
2 tests/v1_1/test_floating_ips_bulk.py
@@ -61,4 +61,4 @@ def test_delete_floating_ips_bulk(self):
fl = cs.floating_ips_bulk.delete('192.168.1.0/30')
body = {'ip_range': '192.168.1.0/30'}
cs.assert_called('PUT', '/os-floating-ips-bulk/delete', body)
- self.assertEqual(fl['floating_ips_bulk_delete'], body['ip_range'])
+ self.assertEqual(fl.floating_ips_bulk_delete, body['ip_range'])

0 comments on commit 219f1df

Please sign in to comment.
Something went wrong with that request. Please try again.