fixed bug 920856

Changed the responses to match that of Amazon EC2
Changed test to expect that response

Change-Id: Ia03a0ea663614944067c0a0193058ba91e149ad2
This commit is contained in:
Thorsten Tarrach
2012-01-30 11:38:06 +01:00
parent c9ac6e1671
commit 553982fb8b
3 changed files with 5 additions and 4 deletions

View File

@@ -148,6 +148,7 @@ Tim Simpson <tim.simpson@rackspace.com>
Todd Willey <todd@ansolabs.com>
Tomoe Sugihara <tomoe@midokura.com>
Tomoya Masuko<masukotm@nttdata.co.jp>
Thorsten Tarrach <thorsten@atomia.com>
Trey Morris <trey.morris@rackspace.com>
Troy Toman <troy.toman@rackspace.com>
Tushar Patil <tushar.vitthal.patil@gmail.com>

View File

@@ -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))

View File

@@ -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"""