summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-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')