nova-manage floating ip fixes

* Add pool, interface to 'floating list' output
  These columns were added to the floating_ips table in
  https://review.openstack.org/2892 and are not visible elsewhere
* Fix 'floating delete' to skip network/broadcast addresses
  Makes the delete command match the create command behaviour
  introduced in https://review.openstack.org/2663
* Address changes listed in bug 817281
  Change host column in output to project ID, change hostname
  column to uuid

Change-Id: Ibbfbe9ed5543927a6b2a1e676f5617901a32f897
This commit is contained in:
Dean Troyer
2012-01-10 15:18:07 -06:00
parent 6cf0c20460
commit b8c4c4040e

View File

@@ -708,7 +708,7 @@ class FloatingIpCommands(object):
@args('--ip_range', dest="ip_range", metavar='<range>', help='IP range')
def delete(self, ip_range):
"""Deletes floating ips by range"""
for address in netaddr.IPNetwork(ip_range):
for address in netaddr.IPNetwork(ip_range).iter_hosts():
db.floating_ip_destroy(context.get_admin_context(),
str(address))
@@ -724,10 +724,12 @@ class FloatingIpCommands(object):
for floating_ip in floating_ips:
instance = None
if floating_ip['fixed_ip']:
instance = floating_ip['fixed_ip']['instance']['hostname']
print "%s\t%s\t%s" % (floating_ip['host'],
floating_ip['address'],
instance)
instance = floating_ip['fixed_ip']['instance']['uuid']
print "%s\t%s\t%s\t%s\t%s" % (floating_ip['project_id'],
floating_ip['address'],
instance,
floating_ip['pool'],
floating_ip['interface'])
class NetworkCommands(object):