diff options
| author | Michael Still <mikal@stillhq.com> | 2012-07-04 14:42:08 +1000 |
|---|---|---|
| committer | Michael Still <mikal@stillhq.com> | 2012-07-26 21:22:04 +1000 |
| commit | fc82c6dbbd0fa1cdc130cefea534967e273d5570 (patch) | |
| tree | db0df1ad88ae8eab2f6911de0e63ce13341d351d /bin | |
| parent | e238e07692c747ddcb0c70452578a812836cea67 (diff) | |
Convert fixed_ips to using instance_uuid.
This should be the second last blueprint finish-uuid-conversion change.
Change-Id: Idd47c5ed3c30af24d60eb23b8e3881d61b4c7976
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-manage | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/bin/nova-manage b/bin/nova-manage index da9d375e4..776dc836b 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -274,9 +274,9 @@ class FixedIpCommands(object): sys.exit(2) instances = db.instance_get_all(context.get_admin_context()) - instances_by_id = {} + instances_by_uuid = {} for instance in instances: - instances_by_id[instance['id']] = instance + instances_by_uuid[instance['uuid']] = instance print "%-18s\t%-15s\t%-15s\t%s" % (_('network'), _('IP address'), @@ -304,8 +304,8 @@ class FixedIpCommands(object): network = all_networks.get(fixed_ip['network_id']) if network: has_ip = True - if fixed_ip.get('instance_id'): - instance = instances_by_id.get(fixed_ip['instance_id']) + if fixed_ip.get('instance_uuid'): + instance = instances_by_uuid.get(fixed_ip['instance_uuid']) if instance: hostname = instance['hostname'] host = instance['host'] @@ -414,16 +414,11 @@ class FloatingIpCommands(object): instance_id = None if floating_ip['fixed_ip_id']: fixed_ip = db.fixed_ip_get(ctxt, floating_ip['fixed_ip_id']) - try: - instance = db.instance_get(ctxt, fixed_ip['instance_id']) - instance_id = instance.get('uuid', "none") - except exception.InstanceNotFound: - msg = _('Missing instance %s') - instance_id = msg % fixed_ip['instance_id'] + instance_uuid = fixed_ip['instance_uuid'] print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'], floating_ip['address'], - instance_id, + instance_uuid, floating_ip['pool'], floating_ip['interface']) |
