diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py index b79eee92289c..527ec1aee48d 100644 --- a/nova/conf/__init__.py +++ b/nova/conf/__init__.py @@ -41,7 +41,7 @@ from nova.conf import conductor from nova.conf import ephemeral_storage from nova.conf import floating_ips from nova.conf import glance -# from nova.conf import guestfs +from nova.conf import guestfs # from nova.conf import host from nova.conf import hyperv # from nova.conf import image @@ -102,7 +102,7 @@ conductor.register_opts(CONF) ephemeral_storage.register_opts(CONF) floating_ips.register_opts(CONF) glance.register_opts(CONF) -# guestfs.register_opts(CONF) +guestfs.register_opts(CONF) # host.register_opts(CONF) hyperv.register_opts(CONF) # image.register_opts(CONF) diff --git a/nova/conf/guestfs.py b/nova/conf/guestfs.py new file mode 100644 index 000000000000..23df1888bf76 --- /dev/null +++ b/nova/conf/guestfs.py @@ -0,0 +1,30 @@ +# Copyright 2015 OpenStack Foundation +# All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +from oslo_config import cfg + +enable_guestfs_debug_opts = cfg.BoolOpt('debug', + default=False, + help='Enable guestfs debug') + +ALL_OPTS = [enable_guestfs_debug_opts] + + +def register_opts(conf): + conf.register_opts(ALL_OPTS, group="guestfs") + + +def list_opts(): + return {"guestfs": ALL_OPTS} diff --git a/nova/virt/disk/vfs/guestfs.py b/nova/virt/disk/vfs/guestfs.py index 8b8e962ab5ea..884b48db9cbc 100644 --- a/nova/virt/disk/vfs/guestfs.py +++ b/nova/virt/disk/vfs/guestfs.py @@ -13,11 +13,11 @@ # under the License. from eventlet import tpool -from oslo_config import cfg from oslo_log import log as logging from oslo_utils import importutils import six +import nova.conf from nova import exception from nova.i18n import _ from nova.i18n import _LW @@ -30,14 +30,7 @@ LOG = logging.getLogger(__name__) guestfs = None forceTCG = False -guestfs_opts = [ - cfg.BoolOpt('debug', - default=False, - help='Enable guestfs debug') -] - -CONF = cfg.CONF -CONF.register_opts(guestfs_opts, group='guestfs') +CONF = nova.conf.CONF def force_tcg(force=True): diff --git a/nova/virt/opts.py b/nova/virt/opts.py index 96fd7d7dc324..a654259bf458 100644 --- a/nova/virt/opts.py +++ b/nova/virt/opts.py @@ -14,7 +14,6 @@ import itertools import nova.conf import nova.virt.configdrive -import nova.virt.disk.vfs.guestfs import nova.virt.libvirt.driver import nova.virt.libvirt.imagebackend import nova.virt.libvirt.imagecache @@ -55,7 +54,6 @@ def list_opts(): itertools.chain( nova.virt.configdrive.configdrive_opts, )), - ('guestfs', nova.virt.disk.vfs.guestfs.guestfs_opts), ('libvirt', itertools.chain( nova.virt.libvirt.driver.libvirt_opts,