Skip to content

Commit

Permalink
nova-manage floating ip fixes
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Dean Troyer committed Jan 10, 2012
1 parent 5165320 commit 9e21a22
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/nova-manage
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand All @@ -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):
Expand Down

0 comments on commit 9e21a22

Please sign in to comment.