From 553982fb8b7e2f8a90b7e873010452fe3b174018 Mon Sep 17 00:00:00 2001 From: Thorsten Tarrach Date: Mon, 30 Jan 2012 11:38:06 +0100 Subject: [PATCH] fixed bug 920856 Changed the responses to match that of Amazon EC2 Changed test to expect that response Change-Id: Ia03a0ea663614944067c0a0193058ba91e149ad2 --- Authors | 1 + nova/api/ec2/cloud.py | 6 +++--- nova/tests/api/ec2/test_cloud.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Authors b/Authors index 90de68183257..588ce08e209f 100644 --- a/Authors +++ b/Authors @@ -148,6 +148,7 @@ Tim Simpson Todd Willey Tomoe Sugihara Tomoya Masuko +Thorsten Tarrach Trey Morris Troy Toman Tushar Patil diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 5a3b952a9796..55969b2eb24a 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1201,7 +1201,7 @@ class CloudController(object): def release_address(self, context, public_ip, **kwargs): LOG.audit(_("Release address %s"), public_ip, context=context) self.network_api.release_floating_ip(context, address=public_ip) - return {'releaseResponse': ["Address released."]} + return {'return': "true"} def associate_address(self, context, instance_id, public_ip, **kwargs): LOG.audit(_("Associate address %(public_ip)s to" @@ -1211,12 +1211,12 @@ class CloudController(object): self.compute_api.associate_floating_ip(context, instance, address=public_ip) - return {'associateResponse': ["Address associated."]} + return {'return': "true"} def disassociate_address(self, context, public_ip, **kwargs): LOG.audit(_("Disassociate address %s"), public_ip, context=context) self.network_api.disassociate_floating_ip(context, address=public_ip) - return {'disassociateResponse': ["Address disassociated."]} + return {'return': "true"} def run_instances(self, context, **kwargs): max_count = int(kwargs.get('max_count', 1)) diff --git a/nova/tests/api/ec2/test_cloud.py b/nova/tests/api/ec2/test_cloud.py index d5fccffb9e60..ee0f318211c6 100644 --- a/nova/tests/api/ec2/test_cloud.py +++ b/nova/tests/api/ec2/test_cloud.py @@ -196,7 +196,7 @@ class CloudTestCase(test.TestCase): 'pool': 'nova', 'project_id': self.project_id}) result = self.cloud.release_address(self.context, address) - self.assertEqual(result['releaseResponse'], ['Address released.']) + self.assertEqual(result.get('return', None), 'true') def test_associate_disassociate_address(self): """Verifies associate runs cleanly without raising an exception"""