]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Cleaning up CONF.register_opts() in compute/__init__.py
authorKendall Nelson <kjnelson@us.ibm.com>
Fri, 21 Aug 2015 18:15:25 +0000 (13:15 -0500)
committerKendall Nelson <kjnelson@us.ibm.com>
Fri, 21 Aug 2015 19:17:25 +0000 (14:17 -0500)
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

cinder/compute/__init__.py

index 96f73b897af05e2164db2ee6750353cd7c4444d5..24a4d1f5743b7d0591cfe377d6f3832eb0779c10 100644 (file)
 #    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()