]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Switching api to use base extension manager
authorMike Perez <thingee@gmail.com>
Mon, 12 Nov 2012 05:37:14 +0000 (21:37 -0800)
committerMike Perez <thingee@gmail.com>
Thu, 22 Nov 2012 05:26:40 +0000 (21:26 -0800)
progress on blueprint apiv2

Change-Id: I68640a88c7c2b7ee4c6661fa26a4f82d9c63b00f

cinder/api/extensions.py
cinder/api/openstack/volume/__init__.py
cinder/api/openstack/volume/extensions.py [deleted file]
cinder/tests/api/extensions/__init__.py [moved from cinder/tests/api/openstack/volume/extensions/__init__.py with 100% similarity]
cinder/tests/api/extensions/foxinsocks.py [moved from cinder/tests/api/openstack/volume/extensions/foxinsocks.py with 100% similarity]
cinder/tests/api/test_extensions.py [moved from cinder/tests/api/openstack/volume/test_extensions.py with 98% similarity]
cinder/tests/integrated/test_extensions.py

index a6886724eb72990cabf08b3ceee17cbc47e2ca47..d558d87a623a49bb2a13a37eca39ff46b1fb5863 100644 (file)
@@ -175,11 +175,18 @@ class ExtensionsResource(wsgi.Resource):
 class ExtensionManager(object):
     """Load extensions from the configured extension path.
 
-    See cinder/tests/api/openstack/extensions/foxinsocks/extension.py for an
+    See cinder/tests/api/extensions/foxinsocks/extension.py for an
     example extension implementation.
 
     """
 
+    def __init__(self):
+        LOG.audit(_('Initializing extension manager.'))
+
+        self.cls_list = FLAGS.osapi_volume_extension
+        self.extensions = {}
+        self._load_extensions()
+
     def is_loaded(self, alias):
         return alias in self.extensions
 
index 0f945190d6b59fd9f0d230cda99774d750a645b7..b82fb8aba74738d3b4534a90a3010ac4795e489e 100644 (file)
@@ -20,8 +20,8 @@
 WSGI middleware for OpenStack Volume API.
 """
 
+from cinder.api import extensions
 import cinder.api.openstack
-from cinder.api.openstack.volume import extensions
 from cinder.api.openstack.volume import limits
 from cinder.api.openstack.volume import snapshots
 from cinder.api.openstack.volume import types
diff --git a/cinder/api/openstack/volume/extensions.py b/cinder/api/openstack/volume/extensions.py
deleted file mode 100644 (file)
index 182f58f..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# vim: tabstop=4 shiftwidth=4 softtabstop=4
-
-# Copyright 2011 OpenStack LLC.
-# 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 cinder.api import extensions as base_extensions
-from cinder import flags
-from cinder.openstack.common import log as logging
-
-
-LOG = logging.getLogger(__name__)
-FLAGS = flags.FLAGS
-
-
-class ExtensionManager(base_extensions.ExtensionManager):
-    def __init__(self):
-        LOG.audit(_('Initializing extension manager.'))
-
-        self.cls_list = FLAGS.osapi_volume_extension
-        self.extensions = {}
-        self._load_extensions()
similarity index 98%
rename from cinder/tests/api/openstack/volume/test_extensions.py
rename to cinder/tests/api/test_extensions.py
index 409f8b4ad8e18dacb11eaf99408709ec5465ccfd..7d998633fbee1e12e9debef1868bd6b5dac26d71 100644 (file)
@@ -34,8 +34,7 @@ class ExtensionTestCase(test.TestCase):
     def setUp(self):
         super(ExtensionTestCase, self).setUp()
         ext_list = FLAGS.osapi_volume_extension[:]
-        fox = ('cinder.tests.api.openstack.volume.extensions.'
-               'foxinsocks.Foxinsocks')
+        fox = ('cinder.tests.api.extensions.foxinsocks.Foxinsocks')
         if fox not in ext_list:
             ext_list.append(fox)
             self.flags(osapi_volume_extension=ext_list)
index 9c580810637939a0bda99c3aab8ebd22bbca0351..363baed66ba16be5c3790e2aef84084433a86abc 100644 (file)
@@ -29,8 +29,7 @@ class ExtensionsTest(integrated_helpers._IntegratedTestBase):
         f = super(ExtensionsTest, self)._get_flags()
         f['osapi_volume_extension'] = FLAGS.osapi_volume_extension[:]
         f['osapi_volume_extension'].append(
-            'cinder.tests.api.openstack.volume.extensions.'
-            'foxinsocks.Foxinsocks')
+            'cinder.tests.api.extensions.foxinsocks.Foxinsocks')
         return f
 
     def test_get_foxnsocks(self):