summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2012-03-05 16:21:41 +0900
committerIsaku Yamahata <yamahata@valinux.co.jp>2012-03-13 16:35:06 +0900
commit7c50652a97fe7ebd74ce38572cbd9744c76b2f71 (patch)
tree2c131c53b1c63b08ae995a0b47927c583c47e5a5 /nova
parent777852191aa9bad3297ab3fe48701e8ec5266d17 (diff)
downloadnova-7c50652a97fe7ebd74ce38572cbd9744c76b2f71.tar.gz
nova-7c50652a97fe7ebd74ce38572cbd9744c76b2f71.tar.xz
nova-7c50652a97fe7ebd74ce38572cbd9744c76b2f71.zip
virt/firewall: NoopFirewallDriver::instance_filter_exists must return True
Otherwise, virt.libvirt.connection.ensure_filtering_rules_for_instance() results in infinite loop. And eliminate NullFirewallDriver as it's same to NoopFirewallDriver. This patch fixes bug 953781. Change-Id: I7936b3c69e9269041defd1ef7e5dda2de1f96dab
Diffstat (limited to 'nova')
-rw-r--r--nova/tests/test_libvirt.py32
-rw-r--r--nova/virt/firewall.py3
2 files changed, 5 insertions, 30 deletions
diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py
index 527961c93..d388a1d4f 100644
--- a/nova/tests/test_libvirt.py
+++ b/nova/tests/test_libvirt.py
@@ -2091,34 +2091,6 @@ class LibvirtConnectionTestCase(test.TestCase):
except Exception:
pass
- class NullFirewallDriver(base_firewall.FirewallDriver):
- def __init__(self, get_connection, **kwargs):
- pass
-
- def prepare_instance_filter(self, instance, network_info):
- pass
-
- def unfilter_instance(self, instance, network_info):
- pass
-
- def apply_instance_filter(self, instance, network_info):
- pass
-
- def refresh_security_group_rules(self, security_group_id):
- pass
-
- def refresh_security_group_members(self, security_group_id):
- pass
-
- def refresh_provider_fw_rules(self):
- pass
-
- def setup_basic_filtering(self, instance, network_info):
- pass
-
- def instance_filter_exists(self, instance, network_info):
- return True
-
def _create_instance(self, params=None):
"""Create a test instance"""
if not params:
@@ -2296,7 +2268,7 @@ class LibvirtConnectionTestCase(test.TestCase):
self.stubs.Set(self.libvirtconnection, '_create_new_domain',
fake_create_new_domain)
self.stubs.Set(utils, 'execute', fake_execute)
- fw = self.NullFirewallDriver(None)
+ fw = base_firewall.NoopFirewallDriver()
self.stubs.Set(self.libvirtconnection, 'firewall_driver', fw)
ins_ref = self._create_instance()
@@ -2321,7 +2293,7 @@ class LibvirtConnectionTestCase(test.TestCase):
self.stubs.Set(self.libvirtconnection, 'plug_vifs', fake_plug_vifs)
self.stubs.Set(utils, 'execute', fake_execute)
- fw = self.NullFirewallDriver(None)
+ fw = base_firewall.NoopFirewallDriver()
self.stubs.Set(self.libvirtconnection, 'firewall_driver', fw)
self.stubs.Set(self.libvirtconnection, '_create_new_domain',
fake_create_new_domain)
diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py
index 3ae12bcb0..3f5333427 100644
--- a/nova/virt/firewall.py
+++ b/nova/virt/firewall.py
@@ -453,3 +453,6 @@ class NoopFirewallDriver(object):
def __getattr__(self, key):
return self._noop
+
+ def instance_filter_exists(self, instance, network_info):
+ return True