Merge "Move to hacking 0.10"

This commit is contained in:
Jenkins 2015-03-02 20:17:02 +00:00 committed by Gerrit Code Review
commit 43c084a336
8 changed files with 14 additions and 15 deletions

View File

@ -307,9 +307,8 @@ class Store(driver.Store):
# Then delete image.
rbd.RBD().remove(ioctx, image_name)
except rbd.ImageNotFound:
raise exceptions.NotFound(message=
_("RBD image %s does not exist")
% image_name)
msg = _("RBD image %s does not exist") % image_name
raise exceptions.NotFound(message=msg)
except rbd.ImageBusy:
log_msg = _("image %s could not be removed "
"because it is in use")
@ -351,9 +350,9 @@ class Store(driver.Store):
loc = self._create_image(fsid, ioctx, image_name,
image_size, order)
except rbd.ImageExists:
raise exceptions.Duplicate(message=
_('RBD image %s already exists')
% image_id)
msg = _('RBD image %s already exists') % image_id
raise exceptions.Duplicate(message=msg)
try:
with rbd.Image(ioctx, image_name) as image:
bytes_written = 0

View File

@ -82,7 +82,7 @@ _S3_OPTS = [
]
class UploadPart:
class UploadPart(object):
"""
The class for the upload part

View File

@ -49,7 +49,7 @@ _SHEEPDOG_OPTS = [
]
class SheepdogImage:
class SheepdogImage(object):
"""Class describing an image stored in Sheepdog storage."""
def __init__(self, addr, port, name, chunk_size):

View File

@ -216,7 +216,7 @@ def check(store_op_fun):
req_cap = op_cap_map[op]
except KeyError:
LOG.warn(_LW('The capability of operation "%s" '
'could not be checked.' % op))
'could not be checked.'), op)
else:
if not store.is_capable(*req_cap):
kwargs.setdefault('offset', 0)

View File

@ -1,5 +1,5 @@
# Metrics and style
hacking>=0.8.0,<0.9
hacking>=0.10.0,<0.11
# Packaging
mock>=1.0

View File

@ -68,7 +68,7 @@ class FakeGridFS(object):
def get(self, location):
self.called_commands.append('get')
class Image:
class Image(object):
_id = "test"
length = 6
md5 = "yoyo"

View File

@ -104,7 +104,7 @@ class FakeKey(object):
return self.data
class FakeMPU:
class FakeMPU(object):
"""
Acts like a ``boto.s3.multipart.MultiPartUpload``
"""
@ -167,7 +167,7 @@ class FakeMPU:
return key
class FakeBucket:
class FakeBucket(object):
"""Acts like a ``boto.s3.bucket.Bucket``."""
def __init__(self, name, keys=None):
self.name = name

View File

@ -27,9 +27,9 @@ commands = {posargs}
[flake8]
# TODO(dmllr): Analyze or fix the warnings blacklisted below
# E711 comparison to None should be 'if cond is not None:'
# H301 one import per line
# H404 multi line docstring should start with a summary
ignore = E711,H301,H404
# H405 multi line docstring summary not separated with an empty line
ignore = H301,H404,H405
builtins = _
exclude = .venv,.git,.tox,dist,doc,etc,*glance_store/locale*,*openstack/common*,*lib/python*,*egg,build