Remove nova.config.CONF
Modules import nova.config for two reasons right now - firstly, to reference nova.config.CONF and, secondly, if they use one of the options defined in nova.config. Often modules import nova.openstack.common.cfg and nova.config which is a bit pointless since they could just use cfg.CONF if they just want to nova.config in order to reference CONF. Let's just use cfg.CONF everywhere and we can explicitly state where we actually require options defined in nova.config. Change-Id: Ie4184a74e3e78c99658becb18dce1c2087e450bb
This commit is contained in:
@@ -18,11 +18,12 @@
|
||||
|
||||
# Importing full names to not pollute the namespace and cause possible
|
||||
# collisions with use of 'from nova.compute import <foo>' elsewhere.
|
||||
import nova.config
|
||||
import nova.openstack.common.cfg
|
||||
import nova.openstack.common.importutils
|
||||
|
||||
|
||||
def API(*args, **kwargs):
|
||||
importutils = nova.openstack.common.importutils
|
||||
cls = importutils.import_class(nova.config.CONF.compute_api_class)
|
||||
compute_api_class = nova.openstack.common.cfg.CONF.compute_api_class
|
||||
cls = importutils.import_class(compute_api_class)
|
||||
return cls(*args, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user