diff --git a/AUTHORS b/AUTHORS index eedf22ef5..7c65b0cae 100644 --- a/AUTHORS +++ b/AUTHORS @@ -13,6 +13,7 @@ Dean Troyer Ed Leafe Edouard Thuleau Eldar Nugaev +François Charlier Gabriel Hurley Gaurav Gupta Ilya Alekseyev diff --git a/novaclient/v1_1/floating_ip_dns.py b/novaclient/v1_1/floating_ip_dns.py index bf92a0f2b..4f49ecd7b 100644 --- a/novaclient/v1_1/floating_ip_dns.py +++ b/novaclient/v1_1/floating_ip_dns.py @@ -80,5 +80,5 @@ class FloatingIPDNSManager(base.ManagerWithFind): qparams = {'name': name} params = "?%s" % urllib.urlencode(qparams) if qparams else "" - return self._delete("/os-floating-ip-dns/%s%s" % + self._delete("/os-floating-ip-dns/%s%s" % (_quote_zone(zone), params)) diff --git a/novaclient/v1_1/floating_ips.py b/novaclient/v1_1/floating_ips.py index 13503e822..eb16cf6a7 100644 --- a/novaclient/v1_1/floating_ips.py +++ b/novaclient/v1_1/floating_ips.py @@ -45,7 +45,7 @@ class FloatingIPManager(base.ManagerWithFind): :param key: The :class:`Keypair` (or its ID) to delete. """ - return self._delete("/os-floating-ips/%s" % base.getid(floating_ip)) + self._delete("/os-floating-ips/%s" % base.getid(floating_ip)) def get(self, floating_ip): """ diff --git a/novaclient/v1_1/images.py b/novaclient/v1_1/images.py index b1ea9f1ea..39e3e6fbf 100644 --- a/novaclient/v1_1/images.py +++ b/novaclient/v1_1/images.py @@ -17,7 +17,7 @@ class Image(base.Resource): """ Delete this image. """ - return self.manager.delete(self) + self.manager.delete(self) class ImageManager(base.ManagerWithFind): diff --git a/novaclient/v1_1/quotas.py b/novaclient/v1_1/quotas.py index 9c5100866..461540b11 100644 --- a/novaclient/v1_1/quotas.py +++ b/novaclient/v1_1/quotas.py @@ -54,7 +54,7 @@ class QuotaSetManager(base.ManagerWithFind): if body['quota_set'][key] == None: body['quota_set'].pop(key) - return self._update('/os-quota-sets/%s' % (tenant_id), body) + self._update('/os-quota-sets/%s' % (tenant_id), body) def defaults(self, tenant_id): return self._get('/os-quota-sets/%s/defaults' % tenant_id, diff --git a/novaclient/v1_1/security_group_rules.py b/novaclient/v1_1/security_group_rules.py index 2cf1e6bc3..2e3ba566b 100644 --- a/novaclient/v1_1/security_group_rules.py +++ b/novaclient/v1_1/security_group_rules.py @@ -60,4 +60,4 @@ class SecurityGroupRuleManager(base.ManagerWithFind): :param rule: The security group rule to delete (ID or Class) """ - return self._delete('/os-security-group-rules/%s' % base.getid(rule)) + self._delete('/os-security-group-rules/%s' % base.getid(rule)) diff --git a/novaclient/v1_1/security_groups.py b/novaclient/v1_1/security_groups.py index 9e737c0a5..56e64d692 100644 --- a/novaclient/v1_1/security_groups.py +++ b/novaclient/v1_1/security_groups.py @@ -52,7 +52,7 @@ class SecurityGroupManager(base.ManagerWithFind): :param group: The security group to delete (group or ID) :rtype: None """ - return self._delete('/os-security-groups/%s' % base.getid(group)) + self._delete('/os-security-groups/%s' % base.getid(group)) def get(self, id): """ diff --git a/novaclient/v1_1/servers.py b/novaclient/v1_1/servers.py index 6388ffb47..218b36bd6 100644 --- a/novaclient/v1_1/servers.py +++ b/novaclient/v1_1/servers.py @@ -117,11 +117,11 @@ class Server(base.Resource): def diagnostics(self): """Diagnostics -- Retrieve server diagnostics.""" - self.manager.diagnostics(self) + return self.manager.diagnostics(self) def actions(self): """Actions -- Retrieve server actions.""" - self.manager.actions(self) + return self.manager.actions(self) def migrate(self): """ diff --git a/novaclient/v1_1/volume_snapshots.py b/novaclient/v1_1/volume_snapshots.py index 40e422cad..d8b1ef3e6 100644 --- a/novaclient/v1_1/volume_snapshots.py +++ b/novaclient/v1_1/volume_snapshots.py @@ -31,7 +31,7 @@ class Snapshot(base.Resource): """ Delete this snapshot. """ - return self.manager.delete(self) + self.manager.delete(self) class SnapshotManager(base.ManagerWithFind): diff --git a/novaclient/v1_1/volumes.py b/novaclient/v1_1/volumes.py index c590b8b8c..60567a1e3 100644 --- a/novaclient/v1_1/volumes.py +++ b/novaclient/v1_1/volumes.py @@ -31,7 +31,7 @@ class Volume(base.Resource): """ Delete this volume. """ - return self.manager.delete(self) + self.manager.delete(self) class VolumeManager(base.ManagerWithFind): @@ -128,5 +128,5 @@ class VolumeManager(base.ManagerWithFind): :param server_id: The ID of the server :param attachment_id: The ID of the attachment """ - return self._delete("/servers/%s/os-volume_attachments/%s" % + self._delete("/servers/%s/os-volume_attachments/%s" % (server_id, attachment_id,)) diff --git a/tests/v1_1/fakes.py b/tests/v1_1/fakes.py index 8434fc2ee..43997ce0f 100644 --- a/tests/v1_1/fakes.py +++ b/tests/v1_1/fakes.py @@ -240,6 +240,23 @@ class FakeHTTPClient(base_client.HTTPClient): def post_servers_1234_metadata(self, **kw): return (204, {'metadata': {'test_key': 'test_value'}}) + def get_servers_1234_diagnostics(self, **kw): + return (200, 'Fake diagnostics') + + def get_servers_1234_actions(self, **kw): + return (200, {'actions': [ + { + 'action': 'rebuild', + 'error': None, + 'created_at': '2011-12-30 11:45:36' + }, + { + 'action': 'reboot', + 'error': 'Failed!', + 'created_at': '2011-12-30 11:40:29' + }, + ]}) + # # Server Addresses # diff --git a/tests/v1_1/test_servers.py b/tests/v1_1/test_servers.py index 60913946e..fa4e9dfa8 100644 --- a/tests/v1_1/test_servers.py +++ b/tests/v1_1/test_servers.py @@ -223,3 +223,27 @@ class ServersTest(utils.TestCase): cs.servers.get_console_output(s, length=50) self.assertEqual(cs.servers.get_console_output(s, length=50), success) cs.assert_called('POST', '/servers/1234/action') + + def test_get_server_actions(self): + s = cs.servers.get(1234) + actions = s.actions() + self.assertTrue(actions is not None) + cs.assert_called('GET', '/servers/1234/actions') + + actions_from_manager = cs.servers.actions(1234) + self.assertTrue(actions_from_manager is not None) + cs.assert_called('GET', '/servers/1234/actions') + + self.assertEqual(actions, actions_from_manager) + + def test_get_server_diagnostics(self): + s = cs.servers.get(1234) + diagnostics = s.diagnostics() + self.assertTrue(diagnostics is not None) + cs.assert_called('GET', '/servers/1234/diagnostics') + + diagnostics_from_manager = cs.servers.diagnostics(1234) + self.assertTrue(diagnostics_from_manager is not None) + cs.assert_called('GET', '/servers/1234/diagnostics') + + self.assertEqual(diagnostics, diagnostics_from_manager)