Skip to content

Commit

Permalink
fixed bug 920856
Browse files Browse the repository at this point in the history
Changed the responses to match that of Amazon EC2
Changed test to expect that response

Change-Id: Ia03a0ea663614944067c0a0193058ba91e149ad2
  • Loading branch information
Thorsten Tarrach committed Feb 1, 2012
1 parent c9ac6e1 commit 553982f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Authors
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions nova/api/ec2/cloud.py
Expand Up @@ -1201,7 +1201,7 @@ def allocate_address(self, context, **kwargs):
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"
Expand All @@ -1211,12 +1211,12 @@ def associate_address(self, context, instance_id, public_ip, **kwargs):
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))
Expand Down
2 changes: 1 addition & 1 deletion nova/tests/api/ec2/test_cloud.py
Expand Up @@ -196,7 +196,7 @@ def test_release_address(self):
'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"""
Expand Down

0 comments on commit 553982f

Please sign in to comment.