From 6537213ddd2a83d052548e980846f80a3c5b94e9 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Thu, 14 Jan 2016 10:40:38 +0000 Subject: [PATCH] config options: Centralise 'virt.firewall' options Add options from 'virt.firewall'. These options are part of the 'DEFAULT' group but are included in the "nova.conf.virt" file in hope that they can eventually be moved to their own group. Change-Id: I54d7bbe416d908edf3447b36e054be189f9d5bf9 Implements: bp centralize-config-options --- nova/conf/virt.py | 12 ++++++++++++ nova/virt/firewall.py | 14 ++------------ nova/virt/opts.py | 2 -- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/nova/conf/virt.py b/nova/conf/virt.py index 601a48883801..47b60f98b674 100644 --- a/nova/conf/virt.py +++ b/nova/conf/virt.py @@ -182,6 +182,16 @@ Interdependencies to other options: * None """) +firewall_driver = cfg.StrOpt( + 'firewall_driver', + help='Firewall driver ' + '(defaults to hypervisor specific iptables driver)') + +allow_same_net_traffic = cfg.BoolOpt( + 'allow_same_net_traffic', + default=True, + help='Whether to allow network traffic from same network') + force_raw_images = cfg.BoolOpt( 'force_raw_images', default=True, @@ -208,6 +218,8 @@ ALL_OPTS = [vcpu_pin_set, use_cow_images, vif_plugging_is_fatal, vif_plugging_timeout, + firewall_driver, + allow_same_net_traffic, force_raw_images] diff --git a/nova/virt/firewall.py b/nova/virt/firewall.py index 0b3120a5e055..61c79cdec63c 100644 --- a/nova/virt/firewall.py +++ b/nova/virt/firewall.py @@ -15,11 +15,11 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from oslo_log import log as logging from oslo_utils import importutils from nova.compute import utils as compute_utils +import nova.conf from nova import context from nova.i18n import _LI from nova.network import linux_net @@ -29,17 +29,7 @@ from nova.virt import netutils LOG = logging.getLogger(__name__) -firewall_opts = [ - cfg.StrOpt('firewall_driver', - help='Firewall driver ' - '(defaults to hypervisor specific iptables driver)'), - cfg.BoolOpt('allow_same_net_traffic', - default=True, - help='Whether to allow network traffic from same network'), -] - -CONF = cfg.CONF -CONF.register_opts(firewall_opts) +CONF = nova.conf.CONF CONF.import_opt('use_ipv6', 'nova.netconf') diff --git a/nova/virt/opts.py b/nova/virt/opts.py index 5de62e50d579..996e456e4f68 100644 --- a/nova/virt/opts.py +++ b/nova/virt/opts.py @@ -17,7 +17,6 @@ import nova.virt.configdrive import nova.virt.disk.api import nova.virt.disk.mount.nbd import nova.virt.disk.vfs.guestfs -import nova.virt.firewall import nova.virt.hyperv.pathutils import nova.virt.hyperv.vif import nova.virt.hyperv.vmops @@ -55,7 +54,6 @@ def list_opts(): nova.virt.configdrive.configdrive_opts, nova.virt.disk.api.disk_opts, nova.virt.disk.mount.nbd.nbd_opts, - nova.virt.firewall.firewall_opts, nova.virt.imagecache.imagecache_opts, nova.virt.netutils.netutils_opts, )),