Skip to content

Commit

Permalink
Moving contrib to cinder.api
Browse files Browse the repository at this point in the history
This moves over all contrib to a common place for all api versions to
use. Test directory structure has been adjusted to match.

For compatibility with old cinder config settings, we ignore the old
contrib path and use the new location.

progress on blueprint apiv2

Change-Id: If1a24fd3c4d15db559674a021f6928613966e3a1
  • Loading branch information
Thingee committed Nov 22, 2012
1 parent 9009948 commit 2581554
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 44 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions cinder/api/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,20 @@ def _load_extensions(self):

extensions = list(self.cls_list)

# NOTE(thingee): Until we update devstack to have the new location,
# we'll just set replace the old contrib path with the new and preserve
# any other extensions that need to be loaded
old_contrib_path = ('cinder.api.openstack.volume.contrib.'
'standard_extensions')
new_contrib_path = 'cinder.api.contrib.standard_extensions'
if old_contrib_path in extensions:
LOG.warn(_('osapi_volume_extension is set to deprecated path: %s'),
old_contrib_path)
LOG.warn(_('Please set your flag or cinder.conf settings for '
'osapi_volume_extension to: %s'), new_contrib_path)
extensions = [e.replace(old_contrib_path, new_contrib_path)
for e in extensions]

for ext_factory in extensions:
try:
self.load_extension(ext_factory)
Expand Down
17 changes: 0 additions & 17 deletions cinder/api/openstack/volume/__init__.py

This file was deleted.

11 changes: 7 additions & 4 deletions cinder/flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ def _get_my_ip():
cfg.ListOpt('osapi_volume_ext_list',
default=[],
help='Specify list of extensions to load when using osapi_'
'volume_extension option with cinder.api.openstack.'
'volume.contrib.select_extensions'),
'volume_extension option with cinder.api.contrib.'
'select_extensions'),
# NOTE(thingee): default contrib for old and new location for compatibility
cfg.MultiStrOpt('osapi_volume_extension',
default=[
'cinder.api.openstack.volume.contrib.standard_extensions'
],
'cinder.api.openstack.volume.contrib.'
'standard_extensions',
'cinder.api.contrib.standard_extensions',
],
help='osapi volume extension to load'),
cfg.StrOpt('osapi_compute_link_prefix',
default=None,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from lxml import etree
import webob

from cinder.api.openstack.volume.contrib import extended_snapshot_attributes
from cinder.api.contrib import extended_snapshot_attributes
from cinder import exception
from cinder import flags
from cinder.openstack.common import jsonutils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from lxml import etree
import webob

from cinder.api.openstack.volume.contrib import types_extra_specs
from cinder.api.contrib import types_extra_specs
from cinder import test
from cinder.tests.api.openstack import fakes
import cinder.wsgi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import webob

from cinder.api.openstack.volume.contrib import types_manage
from cinder.api.contrib import types_manage
from cinder import exception
from cinder import test
from cinder.tests.api.openstack import fakes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import uuid
import webob

from cinder.api.openstack.volume.contrib import volume_actions
from cinder.api.contrib import volume_actions
from cinder import exception
from cinder import flags
from cinder.openstack.common import jsonutils
Expand Down
19 changes: 0 additions & 19 deletions cinder/tests/api/openstack/volume/contrib/__init__.py

This file was deleted.

0 comments on commit 2581554

Please sign in to comment.