Adding only one floating IP to the cloud
Bug #943923 reported by
Édouard Thuleau
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Julien Danjou |
Bug Description
If we try to add only one floating IP (subnet /32) to the cloud with 'nova-mabage' command, nothing appends.
The 'nova-manage' command uses 'netaddr' python library with class 'IPNetwork' which exclude the network and broadcast addresses. So the floating IP '80.0.0.1/32' for example, is exclude and not added to the floating IP list (without warning or errors).
Changed in nova: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Changed in nova: | |
milestone: | none → essex-rc1 |
status: | Fix Committed → Fix Released |
Changed in nova: | |
assignee: | nobody → Julien Danjou (jdanjou) |
Changed in nova: | |
milestone: | essex-rc1 → 2012.1 |
To post a comment you must log in.
diff --git a/bin/nova-manage b/bin/nova-manage nds(object) : floating_ pool
interface = FLAGS.public_ interface ip_create( admin_context, iter_hosts( ):
db. floating_ ip_create( admin_context,
{'address' : str(address), nds(object) : '--ip_range' , dest="ip_range", metavar='<range>', help='IP range') IPNetwork( ip_range) .iter_hosts( ): IPNetwork( ip_range) ip_destroy( context. get_admin_ context( ), iter_hosts( ):
db. floating_ ip_destroy( context. get_admin_ context( ),
str(address) )
index 08c4133..45f23e2 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -702,6 +702,12 @@ class FloatingIpComma
pool = FLAGS.default_
if not interface:
+ if addresses.size == 1:
+ db.floating_
+ {'address': str(addresses.ip),
+ 'pool': pool,
+ 'interface': interface})
+ return
for address in addresses.
@@ -711,7 +717,12 @@ class FloatingIpComma
@args(
def delete(self, ip_range):
"""Deletes floating ips by range"""
- for address in netaddr.
+ addresses = netaddr.
+ if addresses.size == 1:
+ db.floating_
+ str(addresses.ip))
+ return
+ for address in addresses.