Move api_class options to where they are used

The compute_api_class, network_api_class and volume_api_class options
are only used in their respective modules, so move them there.

blueprint: scope-config-opts
Change-Id: Ib0497f46b44c4b3af7319550cc64c09d629ea362
This commit is contained in:
Mark McLoughlin 2013-01-08 07:38:34 +00:00
parent 39ce4032bb
commit 4c43371fd5
5 changed files with 28 additions and 10 deletions

View File

@ -48,7 +48,7 @@ server_opts = [
]
CONF = cfg.CONF
CONF.register_opts(server_opts)
CONF.import_opt('network_api_class', 'nova.config')
CONF.import_opt('network_api_class', 'nova.network')
CONF.import_opt('reclaim_instance_interval', 'nova.compute.manager')
LOG = logging.getLogger(__name__)

View File

@ -21,6 +21,15 @@
import nova.openstack.common.cfg
import nova.openstack.common.importutils
_compute_opts = [
nova.openstack.common.cfg.StrOpt('compute_api_class',
default='nova.compute.api.API',
help='The full class name of the '
'compute API class to use'),
]
nova.openstack.common.cfg.CONF.register_opts(_compute_opts)
def API(*args, **kwargs):
importutils = nova.openstack.common.importutils

View File

@ -87,15 +87,6 @@ global_opts = [
cfg.BoolOpt('use_cow_images',
default=True,
help='Whether to use cow images'),
cfg.StrOpt('compute_api_class',
default='nova.compute.api.API',
help='The full class name of the compute API class to use'),
cfg.StrOpt('network_api_class',
default='nova.network.api.API',
help='The full class name of the network API class to use'),
cfg.StrOpt('volume_api_class',
default='nova.volume.cinder.API',
help='The full class name of the volume API class to use'),
]
cfg.CONF.register_opts(global_opts)

View File

@ -21,6 +21,15 @@
import nova.openstack.common.cfg
import nova.openstack.common.importutils
_network_opts = [
nova.openstack.common.cfg.StrOpt('network_api_class',
default='nova.network.api.API',
help='The full class name of the '
'network API class to use'),
]
nova.openstack.common.cfg.CONF.register_opts(_network_opts)
def API():
importutils = nova.openstack.common.importutils

View File

@ -21,6 +21,15 @@
import nova.openstack.common.cfg
import nova.openstack.common.importutils
_volume_opts = [
nova.openstack.common.cfg.StrOpt('volume_api_class',
default='nova.volume.cinder.API',
help='The full class name of the '
'volume API class to use'),
]
nova.openstack.common.cfg.CONF.register_opts(_volume_opts)
def API():
importutils = nova.openstack.common.importutils