fix floating_ip to follow standard create pattern

This commit is contained in:
Vishvananda Ishaya
2010-09-07 12:37:18 -07:00
parent c2ea3d21bd
commit 2aba4b149c

View File

@@ -87,11 +87,12 @@ class NetworkTestCase(test.TrialTestCase):
"""Makes sure that we can allocaate a public ip"""
# TODO(vish): better way of adding floating ips
pubnet = IPy.IP(flags.FLAGS.public_range)
ip_str = str(pubnet[0])
address = str(pubnet[0])
try:
db.floating_ip_get_by_address(None, ip_str)
db.floating_ip_get_by_address(None, address)
except exception.NotFound:
db.floating_ip_create(None, ip_str, FLAGS.host)
db.floating_ip_create(None, {'address': address,
'host': FLAGS.host})
float_addr = self.network.allocate_floating_ip(self.context,
self.projects[0].id)
fix_addr = self._create_address(0)