summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-01-24 00:44:09 +0000
committerGerrit Code Review <review@openstack.org>2012-01-24 00:44:09 +0000
commitf4963167bedc92e4c33f9de116215f1baec0d670 (patch)
tree869b9178d75e7299d68585ce3687e99533302a39
parentaaa7f7ed456cb9103b07ae629492f3a343ace9d8 (diff)
parent151632ed3a8dfd8da1812e738aca16187dec1175 (diff)
Merge "Fixes nova-manage fixed list."
-rwxr-xr-xbin/nova-manage21
1 files changed, 12 insertions, 9 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 9951785ee..30b62b2d8 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -637,24 +637,27 @@ class FixedIpCommands(object):
print "error: %s" % ex
sys.exit(2)
- print "%-18s\t%-15s\t%-17s\t%-15s\t%s" % (_('network'),
- _('IP address'),
- _('MAC address'),
- _('hostname'),
- _('host'))
+ instances = db.instance_get_all(context.get_admin_context())
+ instances_by_id = {}
+ for instance in instances:
+ instances_by_id[instance['id']] = instance
+
+ print "%-18s\t%-15s\t%-15s\t%s" % (_('network'),
+ _('IP address'),
+ _('hostname'),
+ _('host'))
for fixed_ip in fixed_ips:
hostname = None
host = None
mac_address = None
if fixed_ip['instance']:
- instance = fixed_ip['instance']
+ instance = instances_by_id[fixed_ip['instance_id']]
hostname = instance['hostname']
host = instance['host']
- mac_address = fixed_ip['virtual_interface']['address']
- print "%-18s\t%-15s\t%-17s\t%-15s\t%s" % (
+ print "%-18s\t%-15s\t%-15s\t%s" % (
fixed_ip['network']['cidr'],
fixed_ip['address'],
- mac_address, hostname, host)
+ hostname, host)
@args('--address', dest="address", metavar='<ip address>',
help='IP address')