From: Kendall Nelson Date: Fri, 21 Aug 2015 18:15:25 +0000 (-0500) Subject: Cleaning up CONF.register_opts() in compute/__init__.py X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=86197acd3622ff122e727f56f41a79c4c098fe77;p=openstack-build%2Fcinder-build.git Cleaning up CONF.register_opts() in compute/__init__.py This patch makes the import of oslo_config and registration of _compute_opts consistent with all other imports and registration statements in other files. In a future patch that dynamically generates Cinder config options, it will now be possible to get the options being registered in this file. Change-Id: Ifaae49dd6d0163b5cde44df7b3ca904fb550f211 --- diff --git a/cinder/compute/__init__.py b/cinder/compute/__init__.py index 96f73b897..24a4d1f57 100644 --- a/cinder/compute/__init__.py +++ b/cinder/compute/__init__.py @@ -13,21 +13,22 @@ # License for the specific language governing permissions and limitations # under the License. -import oslo_config.cfg +from oslo_config import cfg from oslo_utils import importutils -_compute_opts = [ - oslo_config.cfg.StrOpt('compute_api_class', - default='cinder.compute.nova.API', - help='The full class name of the ' - 'compute API class to use'), +compute_opts = [ + cfg.StrOpt('compute_api_class', + default='cinder.compute.nova.API', + help='The full class name of the ' + 'compute API class to use'), ] -oslo_config.cfg.CONF.register_opts(_compute_opts) +CONF = cfg.CONF +CONF.register_opts(compute_opts) def API(): - compute_api_class = oslo_config.cfg.CONF.compute_api_class + compute_api_class = CONF.compute_api_class cls = importutils.import_class(compute_api_class) return cls()