summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorTrey Morris <trey.morris@rackspace.com>2011-06-14 17:52:49 -0500
committerTrey Morris <trey.morris@rackspace.com>2011-06-14 17:52:49 -0500
commit9ef64c8ccbcdacfef642b2c203ffcc45b2deaf36 (patch)
treed799f5aad0d380582dbc102d2c5eef05573c8a75 /nova
parentd9d0b416d75cc1c1a4ab03d88cdc8079240566ff (diff)
downloadnova-9ef64c8ccbcdacfef642b2c203ffcc45b2deaf36.tar.gz
nova-9ef64c8ccbcdacfef642b2c203ffcc45b2deaf36.tar.xz
nova-9ef64c8ccbcdacfef642b2c203ffcc45b2deaf36.zip
fixed instance[fixed_ip] in ec2 api, removed fixed_ip shim
Diffstat (limited to 'nova')
-rw-r--r--nova/api/ec2/cloud.py18
-rw-r--r--nova/db/sqlalchemy/models.py6
2 files changed, 12 insertions, 12 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 14a18c330..e74256dfa 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -121,8 +121,8 @@ class CloudController(object):
result = {}
for instance in self.compute_api.get_all(context,
project_id=project_id):
- if instance['fixed_ip']:
- line = '%s slots=%d' % (instance['fixed_ip']['address'],
+ if instance['fixed_ips']:
+ line = '%s slots=%d' % (instance['fixed_ips'][0]['address'],
instance['vcpus'])
key = str(instance['key_name'])
if key in result:
@@ -793,15 +793,15 @@ class CloudController(object):
'name': instance['state_description']}
fixed_addr = None
floating_addr = None
- if instance['fixed_ip']:
- fixed_addr = instance['fixed_ip']['address']
- if instance['fixed_ip']['floating_ips']:
- fixed = instance['fixed_ip']
+ if instance['fixed_ips']:
+ fixed = instance['fixed_ips'][0]
+ fixed_addr = fixed['address']
+ if fixed['floating_ips']:
floating_addr = fixed['floating_ips'][0]['address']
- if instance['fixed_ip']['network'] and 'use_v6' in kwargs:
+ if fixed['network'] and 'use_v6' in kwargs:
i['dnsNameV6'] = ipv6.to_global(
- instance['fixed_ip']['network']['cidr_v6'],
- instance['fixed_ip']['virtual_interface']['address'],
+ fixed['network']['cidr_v6'],
+ fixed['virtual_interface']['address'],
instance['project_id'])
i['privateDnsName'] = fixed_addr
diff --git a/nova/db/sqlalchemy/models.py b/nova/db/sqlalchemy/models.py
index 9455ed95a..e9689774c 100644
--- a/nova/db/sqlalchemy/models.py
+++ b/nova/db/sqlalchemy/models.py
@@ -187,9 +187,9 @@ class Instance(BASE, NovaBase):
#TODO{tr3buchet): i don't like this shim.....
# prevents breaking ec2 api
# should go away with zones when ec2 api doesn't have compute db access
- @property
- def fixed_ip(self):
- return self.fixed_ips[0] if self.fixed_ips else None
+ #@property
+ #def fixed_ip(self):
+ # return self.fixed_ips[0] if self.fixed_ips else None
image_ref = Column(String(255))
kernel_id = Column(String(255))