~ubuntu-branches/ubuntu/quantal/nova/quantal-proposed

« back to all changes in this revision

Viewing changes to nova/api/openstack/compute/contrib/floating_ips.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, Chuck Short
  • Date: 2012-08-27 15:37:18 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20120827153718-lj8er44eqqz1gsrj
Tags: 2012.2~rc1~20120827.15815-0ubuntu1
[ Adam Gandelman ]
* New upstream release.

[ Chuck Short ]
* debian/patches/0001-Update-tools-hacking-for-pep8-1.2-and-
  beyond.patch: Dropped we dont run pep8 tests anymore.
* debian/control: Drop pep8 build depends
* debian/*.upstart.in: Make sure we transition correctly from runlevel
  1 to 2. (LP: #820694)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from nova import exception
28
28
from nova import network
29
29
from nova.openstack.common import log as logging
 
30
from nova import utils
30
31
 
31
32
 
32
33
LOG = logging.getLogger(__name__)
282
283
        instance = get_instance_by_floating_ip_addr(self, context, address)
283
284
 
284
285
        # disassociate if associated
285
 
        if instance and floating_ip.get('fixed_ip_id'):
 
286
        if (instance and
 
287
            floating_ip.get('fixed_ip_id') and
 
288
            (utils.is_uuid_like(id) and
 
289
             [instance['uuid'] == id] or
 
290
             [instance['id'] == id])[0]):
286
291
            disassociate_floating_ip(self, context, instance, address)
287
292
            return webob.Response(status_int=202)
288
293
        else: