summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/tests/test_network.py17
-rw-r--r--nova/virt/libvirt_conn.py2
2 files changed, 10 insertions, 9 deletions
diff --git a/nova/tests/test_network.py b/nova/tests/test_network.py
index 407dbc769..00f9323f3 100644
--- a/nova/tests/test_network.py
+++ b/nova/tests/test_network.py
@@ -99,23 +99,24 @@ class NetworkTestCase(test.TestCase):
def test_private_ipv6(self):
"""Make sure ipv6 is OK"""
if FLAGS.use_ipv6:
- instance_ref = self._create_instance(1)
+ instance_ref = self._create_instance(0)
+ address = self._create_address(0, instance_ref['id'])
network_ref = db.project_get_network(
- self.context,
+ context.get_admin_context(),
self.context.project_id)
address_v6 = db.instance_get_fixed_address_v6(
- self.context,
- instance_ref['id'])
+ context.get_admin_context(),
+ instance_ref['id'])
self.assertEqual(instance_ref['mac_address'],
utils.to_mac(address_v6))
instance_ref2 = db.fixed_ip_get_instance_v6(
- self.context,
- address_v6)
+ context.get_admin_context(),
+ address_v6)
self.assertEqual(instance_ref['id'], instance_ref2['id'])
self.assertEqual(address_v6,
utils.to_global_ipv6(
- network_ref['cidr_v6'],
- instance_ref['mac_address']))
+ network_ref['cidr_v6'],
+ instance_ref['mac_address']))
def test_public_network_association(self):
"""Makes sure that we can allocaate a public ip"""
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py
index f2ffbf180..191292a9d 100644
--- a/nova/virt/libvirt_conn.py
+++ b/nova/virt/libvirt_conn.py
@@ -1141,7 +1141,7 @@ class IptablesFirewallDriver(FirewallDriver):
self.execute('sudo ip6tables-restore',
process_input='\n'.join(new_filter))
- def modify_rules(self, current_lines, ip_version):
+ def modify_rules(self, current_lines, ip_version=4):
ctxt = context.get_admin_context()
# Remove any trace of nova rules.
new_filter = filter(lambda l: 'nova-' not in l, current_lines)