]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Moving common api code into cinder.api
authorMike Perez <thingee@gmail.com>
Sun, 4 Nov 2012 08:34:27 +0000 (01:34 -0700)
committerMike Perez <thingee@gmail.com>
Thu, 22 Nov 2012 05:26:39 +0000 (21:26 -0800)
This is progress for beginning to have separate versions of the
cinder api. Common code that would be shared by v1, v2 etc will use
these modules, so we'll just move them to a common place. Test directory
structure has also been updated.

progress on blueprint apiv2

Change-Id: I99fd95fc3bb5d4f4fc3d9ef5b76b6372a1f6033d

43 files changed:
cinder/api/common.py [moved from cinder/api/openstack/common.py with 99% similarity]
cinder/api/extensions.py [moved from cinder/api/openstack/extensions.py with 99% similarity]
cinder/api/openstack/volume/__init__.py
cinder/api/openstack/volume/contrib/__init__.py
cinder/api/openstack/volume/contrib/admin_actions.py
cinder/api/openstack/volume/contrib/extended_snapshot_attributes.py
cinder/api/openstack/volume/contrib/image_create.py
cinder/api/openstack/volume/contrib/quota_classes.py
cinder/api/openstack/volume/contrib/quotas.py
cinder/api/openstack/volume/contrib/types_extra_specs.py
cinder/api/openstack/volume/contrib/types_manage.py
cinder/api/openstack/volume/contrib/volume_actions.py
cinder/api/openstack/volume/contrib/volume_host_attribute.py
cinder/api/openstack/volume/contrib/volume_tenant_attribute.py
cinder/api/openstack/volume/extensions.py
cinder/api/openstack/volume/limits.py
cinder/api/openstack/volume/snapshots.py
cinder/api/openstack/volume/types.py
cinder/api/openstack/volume/volumes.py
cinder/api/schemas/atom-link.rng [moved from cinder/api/openstack/volume/schemas/atom-link.rng with 100% similarity]
cinder/api/schemas/v1.1/extension.rng [moved from cinder/api/openstack/volume/schemas/v1.1/extension.rng with 100% similarity]
cinder/api/schemas/v1.1/extensions.rng [moved from cinder/api/openstack/volume/schemas/v1.1/extensions.rng with 100% similarity]
cinder/api/schemas/v1.1/limits.rng [moved from cinder/api/openstack/volume/schemas/v1.1/limits.rng with 100% similarity]
cinder/api/schemas/v1.1/metadata.rng [moved from cinder/api/openstack/volume/schemas/v1.1/metadata.rng with 100% similarity]
cinder/api/urlmap.py [moved from cinder/api/openstack/urlmap.py with 100% similarity]
cinder/api/versions.py [moved from cinder/api/openstack/volume/versions.py with 98% similarity]
cinder/api/views/__init__.py [moved from cinder/api/openstack/volume/views/__init__.py with 100% similarity]
cinder/api/views/limits.py [moved from cinder/api/openstack/volume/views/limits.py with 100% similarity]
cinder/api/views/types.py [moved from cinder/api/openstack/volume/views/types.py with 97% similarity]
cinder/api/views/versions.py [moved from cinder/api/openstack/volume/views/versions.py with 100% similarity]
cinder/api/xmlutil.py [moved from cinder/api/openstack/xmlutil.py with 99% similarity]
cinder/tests/api/common.py [moved from cinder/tests/api/openstack/common.py with 100% similarity]
cinder/tests/api/openstack/fakes.py
cinder/tests/api/openstack/test_faults.py
cinder/tests/api/openstack/volume/extensions/foxinsocks.py
cinder/tests/api/openstack/volume/test_extensions.py
cinder/tests/api/openstack/volume/test_limits.py
cinder/tests/api/openstack/volume/test_router.py
cinder/tests/api/openstack/volume/test_types.py
cinder/tests/api/test_common.py [moved from cinder/tests/api/openstack/test_common.py with 98% similarity]
cinder/tests/api/test_xmlutil.py [moved from cinder/tests/api/openstack/test_xmlutil.py with 99% similarity]
cinder/tests/integrated/test_xml.py
etc/cinder/api-paste.ini

similarity index 99%
rename from cinder/api/openstack/common.py
rename to cinder/api/common.py
index 465269cd50b587900271a6a086a265be23e8954b..392bbb551fe6ee63f862c5a3599ea9c03436bfe9 100644 (file)
@@ -22,7 +22,7 @@ import urlparse
 import webob
 
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import flags
 from cinder.openstack.common import log as logging
 
similarity index 99%
rename from cinder/api/openstack/extensions.py
rename to cinder/api/extensions.py
index 718607b9498b98e6e331411ef846e6cfb92ec533..a6886724eb72990cabf08b3ceee17cbc47e2ca47 100644 (file)
@@ -23,7 +23,7 @@ import webob.exc
 
 import cinder.api.openstack
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import exception
 from cinder import flags
 from cinder.openstack.common import exception as common_exception
index 8f5095597424f2f147e1e9e8d73a853e00b435ac..0f945190d6b59fd9f0d230cda99774d750a645b7 100644 (file)
@@ -25,8 +25,8 @@ 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
-from cinder.api.openstack.volume import versions
 from cinder.api.openstack.volume import volumes
+from cinder.api import versions
 from cinder.openstack.common import log as logging
 
 
index 7672a74a863274749c029d23b77ba49cb77830e5..503bc90b8f18db89a738f5e9e9b74b0ed3415b7b 100644 (file)
@@ -21,7 +21,7 @@ It can't be called 'extensions' because that causes namespacing problems.
 
 """
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder import flags
 from cinder.openstack.common import log as logging
 
index 2794b11a117f87b313d871dfb6fa358cbd4bf172..a45b370776817c3f241dbcaafb41f0e8c08f73cf 100644 (file)
@@ -15,7 +15,7 @@
 import webob
 from webob import exc
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
 from cinder import db
 from cinder import exception
index 3b9f8cd2bbf7168e3554de944dbad4269e3bea2d..a14e11b764fcf6f66415837b019122862455f887 100644 (file)
@@ -16,9 +16,9 @@
 
 from webob import exc
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import exception
 from cinder import flags
 from cinder.openstack.common import log as logging
index 51cf6bcbd2639290c5a62b4e20f4ea7538551031..ecfffbf4cbd6f5a9c4ea1d7d319ba947d1994d23 100644 (file)
@@ -19,7 +19,7 @@
 """The Create Volume from Image extension."""\r
 \r
 \r
-from cinder.api.openstack import extensions\r
+from cinder.api import extensions\r
 \r
 \r
 class Image_create(extensions.ExtensionDescriptor):\r
index cbad0e3af87d90ec98d47da854287cedabfb2e5f..897fd31043b763536d622217ba0f0ee6d4dcdc26 100644 (file)
@@ -15,9 +15,9 @@
 
 import webob
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import db
 from cinder import exception
 from cinder import quota
index 7f00863e4a1bf4ec3f1dbdc4fc1916f648c9d5e4..1daa133186580a6e5d6a20e0738b6f63c78adf8b 100644 (file)
@@ -17,9 +17,9 @@
 
 import webob
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import db
 from cinder.db.sqlalchemy import api as sqlalchemy_api
 from cinder import exception
index 50ddb234ab99d07f7ee243c44af3a5448ee59a59..80243eacaca4db694b8d319afd4afde687df972d 100644 (file)
@@ -19,9 +19,9 @@
 
 import webob
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import db
 from cinder import exception
 from cinder.volume import volume_types
index 3ff2efebca7a3ca00fb7c0a17e6669b6654c1e6c..4b0dabc0365892e863ccd9a37661867f4b6fbbf1 100644 (file)
 
 import webob
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack.volume import types
-from cinder.api.openstack.volume.views import types as views_types
 from cinder.api.openstack import wsgi
+from cinder.api.views import types as views_types
 from cinder import exception
 from cinder.volume import volume_types
 
index e0882e9b20ed5620a4052af3a5fd5ff7c02d7eed..2f054215e4c4ccffa98b1d3a3f9e880e9cd25243 100644 (file)
@@ -15,9 +15,9 @@
 import webob
 from xml.dom import minidom
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import exception
 from cinder import flags
 from cinder.openstack.common import log as logging
index 5db3c18ef90f4bbeb56eba40937b3d60c10181cf..183e72587dbdf28f84a95a02f47c244abb4e3e0c 100644 (file)
@@ -12,9 +12,9 @@
 #   License for the specific language governing permissions and limitations
 #   under the License.
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder.openstack.common import log as logging
 from cinder import volume
 
index 193f65bdec4b557167378e4f72e37b8c1d43884c..620ae100652708bec353720943b44d913b350168 100644 (file)
@@ -12,9 +12,9 @@
 #   License for the specific language governing permissions and limitations
 #   under the License.
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import volume
 
 
index af1f367a3eb34b19a21cfce0d193f26b62dfed62..182f58fc3feaad0ba6b75d4ebacdf51f43913114 100644 (file)
@@ -15,7 +15,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from cinder.api.openstack import extensions as base_extensions
+from cinder.api import extensions as base_extensions
 from cinder import flags
 from cinder.openstack.common import log as logging
 
index a9e62dde563a840f505979a429dd631f7f43c9c5..b8a0ad848d8a3edf7b51248d567e9f47f3ec7cc8 100644 (file)
@@ -27,9 +27,9 @@ import time
 import webob.dec
 import webob.exc
 
-from cinder.api.openstack.volume.views import limits as limits_views
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api.views import limits as limits_views
+from cinder.api import xmlutil
 from cinder.openstack.common import importutils
 from cinder.openstack.common import jsonutils
 from cinder import quota
index bf12d30a39384a77c032804fc9278ef242616b27..114b4e58c1deff330035e828beab75a83aae94d9 100644 (file)
 import webob
 from webob import exc
 
-from cinder.api.openstack import common
+from cinder.api import common
 from cinder.api.openstack.volume import volumes
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import exception
 from cinder import flags
 from cinder.openstack.common import log as logging
index 467c22c87d3a6300d6d19d8a9068e4614414f2f6..87583681c733d6244debcb5ef3e2a882fd082e69 100644 (file)
@@ -19,9 +19,9 @@
 
 from webob import exc
 
-from cinder.api.openstack.volume.views import types as views_types
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api.views import types as views_types
+from cinder.api import xmlutil
 from cinder import exception
 from cinder.volume import volume_types
 
index 53abd8b547c8f3298dc3774de9569982d266fba0..065e4d5a663ba5e39495bb940f3a19b007a4794b 100644 (file)
@@ -19,9 +19,9 @@ import webob
 from webob import exc
 from xml.dom import minidom
 
-from cinder.api.openstack import common
+from cinder.api import common
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import exception
 from cinder import flags
 from cinder.openstack.common import log as logging
similarity index 98%
rename from cinder/api/openstack/volume/versions.py
rename to cinder/api/versions.py
index a3cc91f9bfc6979f3c00deafc1da65237439bf1b..f4e4015a00d46b2527bab2deff247f6a4b58230b 100644 (file)
 #    under the License.
 
 import datetime
-
 from lxml import etree
 
-from cinder.api.openstack.volume.views import versions as views_versions
 from cinder.api.openstack import wsgi
-from cinder.api.openstack import xmlutil
+from cinder.api.views import versions as views_versions
+from cinder.api import xmlutil
 
 
 VERSIONS = {
similarity index 97%
rename from cinder/api/openstack/volume/views/types.py
rename to cinder/api/views/types.py
index a0c510cddc264cd06a46224853fb022b80a6c189..4b89167c8d5585499289880ce8584187b1e39e66 100644 (file)
@@ -15,7 +15,7 @@
 #    License for the specific language governing permissions and limitations
 #    under the License.
 
-from cinder.api.openstack import common
+from cinder.api import common
 
 
 class ViewBuilder(common.ViewBuilder):
similarity index 99%
rename from cinder/api/openstack/xmlutil.py
rename to cinder/api/xmlutil.py
index b8461ca5e5bd3ecd90feb6a454688947093ed2d0..105625ba8fef063475c3d3276bbed38af6c80515 100644 (file)
@@ -32,9 +32,9 @@ XMLNS_VOLUME_V1 = 'http://docs.openstack.org/volume/api/v1'
 def validate_schema(xml, schema_name):
     if isinstance(xml, str):
         xml = etree.fromstring(xml)
-    base_path = 'cinder/api/openstack/volume/schemas/v1.1/'
+    base_path = 'cinder/api/schemas/v1.1/'
     if schema_name in ('atom', 'atom-link'):
-        base_path = 'cinder/api/openstack/volume/schemas/'
+        base_path = 'cinder/api/schemas/'
     schema_path = os.path.join(utils.cinderdir(),
                                '%s%s.rng' % (base_path, schema_name))
     schema_doc = etree.parse(schema_path)
index 97a5b95f510556a2b76d79044a53c2610471c1c4..cbc8613b3ffff1d3ccb7bd423bf880e58be7a4d6 100644 (file)
@@ -26,11 +26,11 @@ import webob.request
 from cinder.api import auth as api_auth
 from cinder.api import openstack as openstack_api
 from cinder.api.openstack import auth
-from cinder.api.openstack import urlmap
 from cinder.api.openstack import volume
 from cinder.api.openstack.volume import limits
-from cinder.api.openstack.volume import versions
 from cinder.api.openstack import wsgi as os_wsgi
+from cinder.api import urlmap
+from cinder.api import versions
 from cinder import context
 from cinder import exception as exc
 from cinder.openstack.common import timeutils
index 9c874c8f0200c1a880d3af1e9a13c4bb044de7b8..4ca375e08f6cb2f6d4761c1381ecc9712d320277 100644 (file)
@@ -21,7 +21,7 @@ import webob
 import webob.dec
 import webob.exc
 
-from cinder.api.openstack import common
+from cinder.api import common
 from cinder.api.openstack import wsgi
 from cinder.openstack.common import jsonutils
 from cinder import test
index 5fcd6a2ba05d283d68dfd5793a5e60d07a427250..f01244d77cda3be45e3a74027e0fc7aacea98c1b 100644 (file)
@@ -17,7 +17,7 @@
 
 import webob.exc
 
-from cinder.api.openstack import extensions
+from cinder.api import extensions
 from cinder.api.openstack import wsgi
 
 
index e1e9748bec899d9d26bf629a2a9d294a4c33ea1c..409f8b4ad8e18dacb11eaf99408709ec5465ccfd 100644 (file)
@@ -21,7 +21,7 @@ from lxml import etree
 import webob
 
 from cinder.api.openstack import volume
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import flags
 from cinder.openstack.common import jsonutils
 from cinder import test
index aaa9eb845f551cdd879fdea8e08174d5279b56f7..6a83a08e4249ddb9daced7fd30013500441ba0e9 100644 (file)
@@ -25,8 +25,8 @@ from lxml import etree
 import webob
 
 from cinder.api.openstack.volume import limits
-from cinder.api.openstack.volume import views
-from cinder.api.openstack import xmlutil
+from cinder.api import views
+from cinder.api import xmlutil
 import cinder.context
 from cinder.openstack.common import jsonutils
 from cinder import test
index eba2388c0040180176ef707dbe5a32ce81e9eac9..c0fc754ab8d3eaef242b8a9751091fdab50f427d 100644 (file)
@@ -16,9 +16,9 @@
 
 from cinder.api.openstack import volume
 from cinder.api.openstack.volume import snapshots
-from cinder.api.openstack.volume import versions
 from cinder.api.openstack.volume import volumes
 from cinder.api.openstack import wsgi
+from cinder.api import versions
 from cinder import flags
 from cinder.openstack.common import log as logging
 from cinder import test
index 52380928e4c2c7211ae9df3acf67a7cc15bd8814..9f13b1ff6b003a8383d8549ddb30c4e4617f0c14 100644 (file)
@@ -17,7 +17,7 @@ from lxml import etree
 import webob
 
 from cinder.api.openstack.volume import types
-from cinder.api.openstack.volume.views import types as views_types
+from cinder.api.views import types as views_types
 from cinder import exception
 from cinder.openstack.common import timeutils
 from cinder import test
similarity index 98%
rename from cinder/tests/api/openstack/test_common.py
rename to cinder/tests/api/test_common.py
index b9b1c10152c62dc9f6e70421d00bda48702e2ec2..bcea2befc1b8c7b05c59cd1f702fbd6a875df020 100644 (file)
@@ -22,7 +22,7 @@ Test suites for 'common' code used throughout the OpenStack HTTP API.
 import webob
 import webob.exc
 
-from cinder.api.openstack import common
+from cinder.api import common
 from cinder import test
 
 
@@ -32,7 +32,7 @@ ATOMNS = "{http://www.w3.org/2005/Atom}"
 
 class LimiterTest(test.TestCase):
     """
-    Unit tests for the `cinder.api.openstack.common.limited` method which takes
+    Unit tests for the `cinder.api.common.limited` method which takes
     in a list of items and, depending on the 'offset' and 'limit' GET params,
     returns a subset or complete set of the given items.
     """
@@ -156,7 +156,7 @@ class LimiterTest(test.TestCase):
 
 class PaginationParamsTest(test.TestCase):
     """
-    Unit tests for the `cinder.api.openstack.common.get_pagination_params`
+    Unit tests for the `cinder.api.common.get_pagination_params`
     method which takes in a request object and returns 'marker' and 'limit'
     GET params.
     """
similarity index 99%
rename from cinder/tests/api/openstack/test_xmlutil.py
rename to cinder/tests/api/test_xmlutil.py
index 2c1ab0fb43fd8ea2d42efe785946494215058f1f..1799c45ff12fd65b293fd312674fb66af16af510 100644 (file)
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from cinder.api.openstack import xmlutil
+from cinder.api import xmlutil
 from cinder import test
 
 
index fb579d3f12285c7bf6d8470ae29fc14a56a316a4..2017a89e3f0f626532d40ced58bcd45473d45dec 100644 (file)
@@ -17,7 +17,7 @@
 
 from lxml import etree
 
-from cinder.api.openstack import common
+from cinder.api import common
 from cinder.openstack.common import log as logging
 from cinder.tests.integrated import integrated_helpers
 
index e18a9da22cc7fb46abf94dbcb719ddbfab6fe273..575f4bd6a6d03eb606c2d2fabb7fd24b1470ea70 100644 (file)
@@ -3,7 +3,7 @@
 #############
 
 [composite:osapi_volume]
-use = call:cinder.api.openstack.urlmap:urlmap_factory
+use = call:cinder.api.urlmap:urlmap_factory
 /: osvolumeversions
 /v1: openstack_volume_api_v1
 
@@ -29,7 +29,7 @@ paste.app_factory = cinder.api.openstack.volume:APIRouter.factory
 pipeline = faultwrap osvolumeversionapp
 
 [app:osvolumeversionapp]
-paste.app_factory = cinder.api.openstack.volume.versions:Versions.factory
+paste.app_factory = cinder.api.versions:Versions.factory
 
 ##########
 # Shared #