Rename glance.store to glance_store

Given the existing, known issues, with python namespaces, pip and
setuptools, we've decided to rename glance.store into glance_store.

Change-Id: I3f02ce78b3d64f34744e5116652bfbb4f3062cbf
This commit is contained in:
Flavio Percoco 2014-08-28 10:09:36 +02:00
parent c2335ed752
commit a1c59a1575
73 changed files with 458 additions and 474 deletions

View File

@ -24,7 +24,7 @@ source_suffix = '.rst'
master_doc = 'index'
# General information about the project.
project = u'glance.store'
project = u'glance_store'
copyright = u'2014, OpenStack Foundation'
# If true, '()' will be appended to :func: etc. cross-reference text.

View File

@ -1,7 +1,7 @@
glance.store
glance_store
============
The glance.store library supports the creation, deletion and gather of data
The glance_store library supports the creation, deletion and gather of data
assets from/to a set of several, different, storage technologies
Contents
@ -16,9 +16,9 @@ Release Notes
0.0.1a1
-------
* Initial release of glance.store_.
* Initial release of glance_store_.
.. _glance.store: https://wiki.openstack.org/wiki/Glance/Store
.. _glance_store: https://wiki.openstack.org/wiki/Glance/Store
Indices and tables
==================

View File

@ -1,15 +0,0 @@
# Copyright 2014 Red Hat, Inc.
#
# 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.
__import__('pkg_resources').declare_namespace(__name__)

View File

@ -19,11 +19,11 @@ from cinderclient import service_catalog
from cinderclient.v2 import client as cinderclient
from oslo.config import cfg
from glance.store.common import utils
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
from glance_store.common import utils
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
LOG = logging.getLogger(__name__)
@ -100,7 +100,7 @@ def get_cinderclient(conf, context):
return c
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""Class describing a Cinder URI"""
@ -126,7 +126,7 @@ class StoreLocation(glance.store.location.StoreLocation):
raise exceptions.BadStoreUri(message=reason)
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
"""Cinder backend store adapter."""
@ -155,12 +155,12 @@ class Store(glance.store.driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file and returns the image size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
:rtype int
"""

View File

@ -26,16 +26,16 @@ import urlparse
from oslo.config import cfg
import glance.store
from glance.store.common import utils
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
from glance.store.openstack.common import excutils
from glance.store.openstack.common import jsonutils
from glance.store.openstack.common import processutils
from glance.store.openstack.common import units
import glance_store
from glance_store.common import utils
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
from glance_store.openstack.common import excutils
from glance_store.openstack.common import jsonutils
from glance_store.openstack.common import processutils
from glance_store.openstack.common import units
LOG = logging.getLogger(__name__)
@ -54,7 +54,7 @@ _FILESYSTEM_CONFIGS = [
"contain a valid JSON dict."))]
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""Class describing a Filesystem URI."""
def process_specs(self):
@ -113,7 +113,7 @@ class ChunkedFile(object):
self.fp = None
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
OPTIONS = _FILESYSTEM_CONFIGS
READ_CHUNKSIZE = 64 * units.Ki
@ -281,7 +281,7 @@ class Store(glance.store.driver.Store):
with open(metadata_file, 'r') as fptr:
metadata = jsonutils.load(fptr)
glance.store.check_location_metadata(metadata)
glance_store.check_location_metadata(metadata)
return metadata
except exceptions.BackendException as bee:
LOG.error(_('The JSON in the metadata file %(file)s could not '
@ -303,13 +303,13 @@ class Store(glance.store.driver.Store):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
filepath, filesize = self._resolve_location(location)
msg = _("Found image at %s. Returning in ChunkedFile.") % filepath
@ -320,12 +320,12 @@ class Store(glance.store.driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file and returns the image size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
:rtype int
"""
filepath, filesize = self._resolve_location(location)
@ -335,11 +335,11 @@ class Store(glance.store.driver.Store):
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist
:raises Forbidden if cannot delete because of permissions
@ -417,7 +417,7 @@ class Store(glance.store.driver.Store):
:retval tuple of URL in backing store, bytes written, checksum
and a dictionary with storage system specific information
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
:note By default, the backend writes the image data to a file

View File

@ -21,11 +21,11 @@ import urlparse
from oslo.config import cfg
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
from glance.store.openstack.common import excutils
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
from glance_store.openstack.common import excutils
try:
import gridfs
@ -48,7 +48,7 @@ _GRIDFS_OPTS = [
]
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""
Class describing an gridfs URI:
@ -77,7 +77,7 @@ class StoreLocation(glance.store.location.StoreLocation):
self.specs["image_id"] = parsed.netloc
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
"""GridFS adapter"""
OPTIONS = _GRIDFS_OPTS
@ -119,25 +119,25 @@ class Store(glance.store.driver.Store):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
image = self._get_file(location)
return (image, image.length)
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the image_size (or 0
if unavailable)
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
try:
key = self._get_file(location)
@ -147,7 +147,7 @@ class Store(glance.store.driver.Store):
def _get_file(self, location):
store_location = location
if isinstance(location, glance.store.location.Location):
if isinstance(location, glance_store.location.Location):
store_location = location.store_location
try:
@ -171,7 +171,7 @@ class Store(glance.store.driver.Store):
:retval tuple of URL in backing store, bytes written, checksum
and a dictionary with storage system specific information
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
"""
loc = StoreLocation({'image_id': image_id})
@ -201,11 +201,11 @@ class Store(glance.store.driver.Store):
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist
"""

View File

@ -18,10 +18,10 @@ import logging
import socket
import urlparse
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
LOG = logging.getLogger(__name__)
@ -29,7 +29,7 @@ LOG = logging.getLogger(__name__)
MAX_REDIRECTS = 5
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""Class describing an HTTP(S) URI"""
@ -106,25 +106,25 @@ def http_response_iterator(conn, response, size):
conn.close()
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
"""An implementation of the HTTP(S) Backend Adapter"""
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
conn, resp, content_length = self._query(location, 'GET')
cs = chunk_size or self.READ_CHUNKSIZE
iterator = http_response_iterator(conn, resp, cs)
class ResponseIndexable(glance.store.Indexable):
class ResponseIndexable(glance_store.Indexable):
def another(self):
try:
return self.wrapped.next()
@ -138,11 +138,11 @@ class Store(glance.store.driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
try:
size = self._query(location, 'HEAD')[2]
@ -189,7 +189,7 @@ class Store(glance.store.driver.Store):
dict(url=loc.path, status=resp.status))
LOG.info(reason)
raise exceptions.BadStoreUri(message=reason)
location_class = glance.store.location.Location
location_class = glance_store.location.Location
new_loc = location_class(location.store_name,
location.store_location.__class__,
uri=location_header,

View File

@ -25,12 +25,12 @@ import urllib
from oslo.config import cfg
from glance.store.common import utils
from glance.store import driver
from glance.store import exceptions
from glance.store import i18n
from glance.store.i18n import _
from glance.store import location
from glance_store.common import utils
from glance_store import driver
from glance_store import exceptions
from glance_store import i18n
from glance_store.i18n import _
from glance_store import location
try:
import rados
@ -206,13 +206,13 @@ class Store(driver.Store):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
loc = location.store_location
return (ImageIterator(loc.image, self),
@ -220,12 +220,12 @@ class Store(driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
loc = location.store_location
with rados.Rados(conffile=self.conf_file,
@ -250,7 +250,7 @@ class Store(driver.Store):
:param image_name Image's name
:retval `glance.store.rbd.StoreLocation` object
:retval `glance_store.rbd.StoreLocation` object
"""
librbd = rbd.RBD()
if hasattr(rbd, 'RBD_FEATURE_LAYERING'):
@ -318,7 +318,7 @@ class Store(driver.Store):
:retval tuple of URL in backing store, bytes written, checksum
and a dictionary with storage system specific information
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
"""
checksum = hashlib.md5()
@ -385,11 +385,11 @@ class Store(driver.Store):
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete.
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist;
InUseByStore if image is in use or snapshot unprotect failed

View File

@ -24,13 +24,13 @@ import urlparse
from oslo.config import cfg
import glance.store
from glance.store.common import utils
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
from glance.store.openstack.common import units
import glance_store
from glance_store.common import utils
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
from glance_store.openstack.common import units
LOG = logging.getLogger(__name__)
@ -57,7 +57,7 @@ _S3_OPTS = [
]
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""
Class describing an S3 URI. An S3 URI can look like any of
@ -208,7 +208,7 @@ class ChunkedFile(object):
self.fp = None
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
"""An implementation of the s3 adapter."""
OPTIONS = _S3_OPTS
@ -262,19 +262,19 @@ class Store(glance.store.driver.Store):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
key = self._retrieve_key(location)
cs = chunk_size or self.READ_CHUNKSIZE
key.BufferSize = cs
class ChunkedIndexable(glance.store.Indexable):
class ChunkedIndexable(glance_store.Indexable):
def another(self):
return (self.wrapped.fp.read(cs)
if self.wrapped.fp else None)
@ -283,12 +283,12 @@ class Store(glance.store.driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the image_size (or 0
if unavailable)
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
try:
key = self._retrieve_key(location)
@ -333,7 +333,7 @@ class Store(glance.store.driver.Store):
:retval tuple of URL in backing store, bytes written, checksum
and a dictionary with storage system specific information
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
S3 writes the image data using the scheme:
@ -430,11 +430,11 @@ class Store(glance.store.driver.Store):
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist
"""
@ -470,7 +470,7 @@ def get_bucket(conn, bucket_id):
:param conn: The ``boto.s3.connection.S3Connection``
:param bucket_id: ID of the bucket to fetch
:raises ``glance.store.exceptions.NotFound`` if bucket is not found.
:raises ``glance_store.exceptions.NotFound`` if bucket is not found.
"""
bucket = conn.get_bucket(bucket_id)
@ -519,14 +519,14 @@ def create_bucket_if_missing(bucket, s3_conn):
except S3ResponseError as e:
msg = (_("Failed to add bucket to S3.\n"
"Got error from S3: %(e)s") % {'e': e})
raise glance.store.BackendException(msg)
raise glance_store.BackendException(msg)
else:
msg = (_("The bucket %(bucket)s does not exist in "
"S3. Please set the "
"s3_store_create_bucket_on_put option "
"to add bucket to S3 automatically.")
% {'bucket': bucket})
raise glance.store.BackendException(msg)
raise glance_store.BackendException(msg)
def get_key(bucket, obj):
@ -535,7 +535,7 @@ def get_key(bucket, obj):
:param bucket: The ``boto.s3.Bucket``
:param obj: Object to get the key for
:raises ``glance.store.exceptions.NotFound`` if key is not found.
:raises ``glance_store.exceptions.NotFound`` if key is not found.
"""
key = bucket.get_key(obj)

View File

@ -20,14 +20,14 @@ import logging
from oslo.config import cfg
import glance.store
import glance.store.driver
from glance.store import exceptions
from glance.store.i18n import _
import glance.store.location
from glance.store.openstack.common import excutils
from glance.store.openstack.common import processutils
from glance.store.openstack.common import units
import glance_store
import glance_store.driver
from glance_store import exceptions
from glance_store.i18n import _
import glance_store.location
from glance_store.openstack.common import excutils
from glance_store.openstack.common import processutils
from glance_store.openstack.common import units
LOG = logging.getLogger(__name__)
@ -76,7 +76,7 @@ class SheepdogImage:
cmd, process_input=data, shell=True)[0]
except processutils.ProcessExecutionError as exc:
LOG.error(exc)
raise glance.store.BackendException(exc)
raise glance_store.BackendException(exc)
def get_size(self):
"""
@ -134,7 +134,7 @@ class SheepdogImage:
return True
class StoreLocation(glance.store.location.StoreLocation):
class StoreLocation(glance_store.location.StoreLocation):
"""
Class describing a Sheepdog URI. This is of the form:
@ -175,7 +175,7 @@ class ImageIterator(object):
raise StopIteration()
class Store(glance.store.driver.Store):
class Store(glance_store.driver.Store):
"""Sheepdog backend adapter."""
EXAMPLE_URL = "sheepdog://image"
@ -214,13 +214,13 @@ class Store(glance.store.driver.Store):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a generator for reading
the image file
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
loc = location.store_location
@ -233,12 +233,12 @@ class Store(glance.store.driver.Store):
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file and returns the image size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
:rtype int
"""
@ -261,7 +261,7 @@ class Store(glance.store.driver.Store):
:param image_size: The size of the image data to write, in bytes
:retval tuple of URL in backing store, bytes written, and checksum
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
"""
@ -294,11 +294,11 @@ class Store(glance.store.driver.Store):
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist
"""

View File

@ -13,5 +13,5 @@
# License for the specific language governing permissions and limitations
# under the License.
from glance.store._drivers.swift import utils # noqa
from glance.store._drivers.swift.store import * # noqa
from glance_store._drivers.swift import utils # noqa
from glance_store._drivers.swift.store import * # noqa

View File

@ -25,14 +25,14 @@ import six.moves.urllib.parse as urlparse
import swiftclient
import urllib
import glance.store
from glance.store._drivers.swift import utils as sutils
from glance.store.common import auth
from glance.store import driver
from glance.store import exceptions
from glance.store import i18n
from glance.store import location
from glance.store.openstack.common import excutils
import glance_store
from glance_store._drivers.swift import utils as sutils
from glance_store.common import auth
from glance_store import driver
from glance_store import exceptions
from glance_store import i18n
from glance_store import location
from glance_store.openstack.common import excutils
_ = i18n._
LOG = logging.getLogger(__name__)
@ -406,7 +406,7 @@ class BaseStore(driver.Store):
(resp_headers, resp_body) = self._get_object(location, connection,
context=context)
class ResponseIndexable(glance.store.Indexable):
class ResponseIndexable(glance_store.Indexable):
def another(self):
try:
return self.wrapped.next()
@ -577,7 +577,7 @@ class BaseStore(driver.Store):
msg = (_(u"Failed to add object to Swift.\n"
"Got error from Swift: %s") % unicode(e))
LOG.error(msg)
raise glance.store.BackendException(msg)
raise glance_store.BackendException(msg)
def delete(self, location, connection=None, context=None):
location = location.store_location
@ -641,14 +641,14 @@ class BaseStore(driver.Store):
except swiftclient.ClientException as e:
msg = (_("Failed to add container to Swift.\n"
"Got error from Swift: %(e)s") % {'e': e})
raise glance.store.BackendException(msg)
raise glance_store.BackendException(msg)
else:
msg = (_("The container %(container)s does not exist in "
"Swift. Please set the "
"swift_store_create_container_on_put option"
"to add container to Swift automatically.") %
{'container': container})
raise glance.store.BackendException(msg)
raise glance_store.BackendException(msg)
else:
raise

View File

@ -22,8 +22,8 @@ except ImportError:
from oslo.config import cfg
from glance.store import exceptions
from glance.store import i18n
from glance_store import exceptions
from glance_store import i18n
swift_opts = [
cfg.StrOpt('default_swift_reference',

View File

@ -25,11 +25,11 @@ from oslo.config import cfg
from oslo.vmware import api
import six.moves.urllib.parse as urlparse
import glance.store
from glance.store import exceptions
from glance.store.i18n import _
from glance.store import location
from glance.store.openstack.common import excutils
import glance_store
from glance_store import exceptions
from glance_store.i18n import _
from glance_store import location
from glance_store.openstack.common import excutils
LOG = logging.getLogger(__name__)
@ -202,7 +202,7 @@ class StoreLocation(location.StoreLocation):
#raise exceptions.BadStoreUri(reason)
class Store(glance.store.Store):
class Store(glance_store.Store):
"""An implementation of the VMware datastore adapter."""
OPTIONS = _VMWARE_OPTS
@ -317,12 +317,12 @@ class Store(glance.store.Store):
return (loc.get_uri(), image_file.size, checksum.hexdigest(), {})
def get(self, location, offset=0, chunk_size=None, context=None):
"""Takes a `glance.store.location.Location` object that indicates
"""Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location: `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location: `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
cookie = self._build_vim_cookie_header(
self._session.vim.client.options.transport.cookiejar)
@ -331,7 +331,7 @@ class Store(glance.store.Store):
headers={'Cookie': cookie})
iterator = http_response_iterator(conn, resp, self.CHUNKSIZE)
class ResponseIndexable(glance.store.Indexable):
class ResponseIndexable(glance_store.Indexable):
def another(self):
try:
@ -342,11 +342,11 @@ class Store(glance.store.Store):
return (ResponseIndexable(iterator, content_length), content_length)
def get_size(self, location, context=None):
"""Takes a `glance.store.location.Location` object that indicates
"""Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the size
:param location: `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location: `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
"""
cookie = self._build_vim_cookie_header(
self._session.vim.client.options.transport.cookiejar)
@ -354,11 +354,11 @@ class Store(glance.store.Store):
return self._query(location, 'HEAD', headers={'Cookie': cookie})[2]
def delete(self, location, context=None):
"""Takes a `glance.store.location.Location` object that indicates
"""Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises NotFound if image does not exist
"""
file_path = '[%s] %s' % (
@ -413,7 +413,7 @@ class Store(glance.store.Store):
% {'path': loc.path, 'status': resp.status})
LOG.info(reason)
raise exceptions.BadStoreUri(message=reason)
location_class = glance.store.location.Location
location_class = glance_store.location.Location
new_loc = location_class(location.store_name,
location.store_location.__class__,
uri=location_header,

View File

@ -19,9 +19,9 @@ import sys
from oslo.config import cfg
from stevedore import driver
from glance.store import exceptions
from glance.store.i18n import _
from glance.store import location
from glance_store import exceptions
from glance_store.i18n import _
from glance_store import location
LOG = logging.getLogger(__name__)
@ -127,7 +127,7 @@ def _load_store(conf, store_entry):
store_cls = None
try:
LOG.debug("Attempting to import store %s", store_entry)
mgr = driver.DriverManager('glance.store.drivers',
mgr = driver.DriverManager('glance_store.drivers',
store_entry,
invoke_args=[conf],
invoke_on_load=True)

View File

@ -33,7 +33,7 @@ import logging
import six.moves.urllib.parse as urlparse
from glance.store.openstack.common import jsonutils
from glance_store.openstack.common import jsonutils
LOG = logging.getLogger(__name__)

View File

@ -20,10 +20,10 @@ import logging
from oslo.config import cfg
from glance.store import exceptions
from glance.store.i18n import _
from glance.store.openstack.common import importutils
from glance.store.openstack.common import strutils
from glance_store import exceptions
from glance_store.i18n import _
from glance_store.openstack.common import importutils
from glance_store.openstack.common import strutils
LOG = logging.getLogger(__name__)
@ -113,24 +113,24 @@ class Store(object):
def get(self, location, offset=0, chunk_size=None, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns a tuple of generator
(for reading the image file) and image_size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance.exceptions.NotFound` if image does not exist
"""
raise NotImplementedError
def get_size(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file, and returns the size
:param location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:param location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
raise NotImplementedError
@ -154,19 +154,19 @@ class Store(object):
:retval tuple of URL in backing store, bytes written, checksum
and a dictionary with storage system specific information
:raises `glance.store.exceptions.Duplicate` if the image already
:raises `glance_store.exceptions.Duplicate` if the image already
existed
"""
raise NotImplementedError
def delete(self, location, context=None):
"""
Takes a `glance.store.location.Location` object that indicates
Takes a `glance_store.location.Location` object that indicates
where to find the image file to delete
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:raises `glance.store.exceptions.NotFound` if image does not exist
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:raises `glance_store.exceptions.NotFound` if image does not exist
"""
raise NotImplementedError
@ -176,8 +176,8 @@ class Store(object):
Sets the read and write access control list for an image in the
backend store.
:location `glance.store.location.Location` object, supplied
from glance.store.location.get_location_from_uri()
:location `glance_store.location.Location` object, supplied
from glance_store.location.get_location_from_uri()
:public A boolean indicating whether the image should be public.
:read_tenants A list of tenant strings which should be granted
read access for an image.

View File

@ -15,7 +15,7 @@
"""Glance Store exception subclasses"""
from glance.store.i18n import _
from glance_store.i18n import _
class BackendException(Exception):

View File

@ -15,7 +15,7 @@
from oslo import i18n
_translators = i18n.TranslatorFactory(domain='glance.store')
_translators = i18n.TranslatorFactory(domain='glance_store')
# The primary translation function using the well-known name "_"
_ = _translators.primary

View File

@ -1,13 +1,13 @@
# Translations template for glance.store.
# Translations template for glance_store.
# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the glance.store
# This file is distributed under the same license as the glance_store
# project.
#
# Translators:
# Andreas Jaeger <jaegerandi@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: glance.store\n"
"Project-Id-Version: glance_store\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-07-29 06:00+0000\n"
"PO-Revision-Date: 2014-07-16 18:34+0000\n"
@ -21,12 +21,12 @@ msgstr ""
"Generated-By: Babel 1.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: glance/store/openstack/common/excutils.py:76
#: glance_store/openstack/common/excutils.py:76
#, python-format
msgid "Original exception being dropped: %s"
msgstr "Ursprüngliche Ausnahme wird gelöscht: %s"
#: glance/store/openstack/common/excutils.py:105
#: glance_store/openstack/common/excutils.py:105
#, python-format
msgid "Unexpected exception occurred %d time(s)... retrying."
msgstr "Unerwartete Ausnahme %d mal(e) aufgetreten... Neuversuch."

View File

@ -1,12 +1,12 @@
# Translations template for glance.store.
# Translations template for glance_store.
# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the glance.store
# This file is distributed under the same license as the glance_store
# project.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: glance.store\n"
"Project-Id-Version: glance_store\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-07-29 06:00+0000\n"
"PO-Revision-Date: 2014-07-16 18:34+0000\n"
@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 1.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: glance/store/openstack/common/excutils.py:76
#: glance_store/openstack/common/excutils.py:76
#, python-format
msgid "Original exception being dropped: %s"
msgstr "Original exception being dropped: %s"
#: glance/store/openstack/common/excutils.py:105
#: glance_store/openstack/common/excutils.py:105
#, python-format
msgid "Unexpected exception occurred %d time(s)... retrying."
msgstr "Unexpected exception occurred %d time(s)... retrying."

View File

@ -6,7 +6,7 @@
# Andi Chandler <andi@gowling.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: glance.store\n"
"Project-Id-Version: glance_store\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-07-29 06:00+0000\n"
"PO-Revision-Date: 2014-07-25 23:07+0000\n"

View File

@ -1,12 +1,12 @@
# Translations template for glance.store.
# Translations template for glance_store.
# Copyright (C) 2014 ORGANIZATION
# This file is distributed under the same license as the glance.store
# This file is distributed under the same license as the glance_store
# project.
#
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: glance.store\n"
"Project-Id-Version: glance_store\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2014-07-29 06:00+0000\n"
"PO-Revision-Date: 2014-07-16 18:34+0000\n"
@ -20,12 +20,12 @@ msgstr ""
"Generated-By: Babel 1.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: glance/store/openstack/common/excutils.py:76
#: glance_store/openstack/common/excutils.py:76
#, python-format
msgid "Original exception being dropped: %s"
msgstr "Original exception being dropped: %s"
#: glance/store/openstack/common/excutils.py:105
#: glance_store/openstack/common/excutils.py:105
#, python-format
msgid "Unexpected exception occurred %d time(s)... retrying."
msgstr "Unexpected exception occurred %d time(s)... retrying."

View File

@ -1,12 +1,12 @@
# Translations template for glance.store.
# Translations template for glance_store.