removed some volume occurances

This commit is contained in:
Yulia Portnova 2013-09-05 11:33:10 +03:00
parent 640b4b9176
commit 84aa8c2dee
8 changed files with 8 additions and 39 deletions

@ -25,7 +25,7 @@ from manila.api import extensions
class Image_create(extensions.ExtensionDescriptor):
"""Allow creating a volume from an image in the Create Volume v1 API"""
name = "CreateVolumeExtension"
name = "CreateShareExtension"
alias = "os-image-create"
namespace = "http://docs.openstack.org/volume/ext/image-create/api/v1"
updated = "2012-08-13T00:00:00+00:00"

@ -26,7 +26,7 @@ from manila import quota
QUOTAS = quota.QUOTAS
authorize = extensions.extension_authorizer('volume', 'quota_classes')
authorize = extensions.extension_authorizer('share', 'quota_classes')
class QuotaClassTemplate(xmlutil.TemplateBuilder):

@ -29,7 +29,7 @@ from manila import utils
LOG = logging.getLogger(__name__)
authorize = extensions.extension_authorizer('volume', 'services')
authorize = extensions.extension_authorizer('share', 'services')
class ServicesIndexTemplate(xmlutil.TemplateBuilder):

@ -271,7 +271,7 @@ class ExtensionManager(object):
# NOTE(thingee): Backwards compat for the old extension loader path.
# We can drop this post-grizzly in the H release.
old_contrib_path = ('manila.api.openstack.volume.contrib.'
old_contrib_path = ('manila.api.openstack.share.contrib.'
'standard_extensions')
new_contrib_path = 'manila.api.contrib.standard_extensions'
if old_contrib_path in extensions:

@ -18,7 +18,7 @@
# under the License.
"""
WSGI middleware for OpenStack Volume API.
WSGI middleware for OpenStack Share API.
"""
from manila.api import extensions

@ -270,7 +270,7 @@ class Versions(wsgi.Resource):
return args
class VolumeVersionV1(object):
class ShareVersionV1(object):
@wsgi.serializers(xml=VersionTemplate,
atom=VersionAtomSerializer)
def show(self, req):
@ -279,4 +279,4 @@ class VolumeVersionV1(object):
def create_resource():
return wsgi.Resource(VolumeVersionV1())
return wsgi.Resource(ShareVersionV1())

@ -153,7 +153,7 @@ global_opts = [
'select_extensions'),
cfg.MultiStrOpt('osapi_share_extension',
default=['manila.api.contrib.standard_extensions'],
help='osapi volume extension to load'),
help='osapi share extension to load'),
cfg.StrOpt('osapi_share_base_URL',
default=None,
help='Base URL that will be presented to users in links '

@ -250,34 +250,3 @@ def fetch_to_raw(context, image_service,
os.unlink(tmp)
def upload_volume(context, image_service, image_meta, volume_path):
image_id = image_meta['id']
if (image_meta['disk_format'] == 'raw'):
LOG.debug("%s was raw, no need to convert to %s" %
(image_id, image_meta['disk_format']))
with utils.temporary_chown(volume_path):
with utils.file_open(volume_path) as image_file:
image_service.update(context, image_id, {}, image_file)
return
if (FLAGS.image_conversion_dir and not
os.path.exists(FLAGS.image_conversion_dir)):
os.makedirs(FLAGS.image_conversion_dir)
fd, tmp = tempfile.mkstemp(dir=FLAGS.image_conversion_dir)
os.close(fd)
with utils.remove_path_on_error(tmp):
LOG.debug("%s was raw, converting to %s" %
(image_id, image_meta['disk_format']))
convert_image(volume_path, tmp, image_meta['disk_format'])
data = qemu_img_info(tmp)
if data.file_format != image_meta['disk_format']:
raise exception.ImageUnacceptable(
image_id=image_id,
reason=_("Converted to %(f1)s, but format is now %(f2)s") %
{'f1': image_meta['disk_format'], 'f2': data.file_format})
with utils.file_open(tmp) as image_file:
image_service.update(context, image_id, {}, image_file)
os.unlink(tmp)