summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorMichael Still <mikal@stillhq.com>2012-07-04 14:42:08 +1000
committerMichael Still <mikal@stillhq.com>2012-07-26 21:22:04 +1000
commitfc82c6dbbd0fa1cdc130cefea534967e273d5570 (patch)
treedb0df1ad88ae8eab2f6911de0e63ce13341d351d /nova/api
parente238e07692c747ddcb0c70452578a812836cea67 (diff)
downloadnova-fc82c6dbbd0fa1cdc130cefea534967e273d5570.tar.gz
nova-fc82c6dbbd0fa1cdc130cefea534967e273d5570.tar.xz
nova-fc82c6dbbd0fa1cdc130cefea534967e273d5570.zip
Convert fixed_ips to using instance_uuid.
This should be the second last blueprint finish-uuid-conversion change. Change-Id: Idd47c5ed3c30af24d60eb23b8e3881d61b4c7976
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/metadata/base.py2
-rw-r--r--nova/api/openstack/compute/contrib/floating_ips.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/nova/api/metadata/base.py b/nova/api/metadata/base.py
index 4ecf64649..2964d57f1 100644
--- a/nova/api/metadata/base.py
+++ b/nova/api/metadata/base.py
@@ -214,7 +214,7 @@ def get_metadata_by_address(address):
ctxt = context.get_admin_context()
fixed_ip = network.API().get_fixed_ip_by_address(ctxt, address)
- instance = db.instance_get(ctxt, fixed_ip['instance_id'])
+ instance = db.instance_get_by_uuid(ctxt, fixed_ip['instance_uuid'])
return InstanceMetadata(instance, address)
diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py
index 4b290bb4c..6fb9f0cc1 100644
--- a/nova/api/openstack/compute/contrib/floating_ips.py
+++ b/nova/api/openstack/compute/contrib/floating_ips.py
@@ -120,13 +120,13 @@ class FloatingIPController(object):
fixed_ip_id = floating_ip['fixed_ip_id']
floating_ip['fixed_ip'] = self._get_fixed_ip(context,
fixed_ip_id)
- instance_id = None
+ instance_uuid = None
if floating_ip['fixed_ip']:
- instance_id = floating_ip['fixed_ip']['instance_id']
+ instance_uuid = floating_ip['fixed_ip']['instance_uuid']
- if instance_id:
+ if instance_uuid:
floating_ip['instance'] = self._get_instance(context,
- instance_id)
+ instance_uuid)
else:
floating_ip['instance'] = None