Move to hacking 0.10

Release notes:
http://git.openstack.org/cgit/openstack-dev/hacking/tag/?id=0.10.0

Change-Id: Iaed2de813fb181ab9f67dda50a4c19d1b9a7dc31
This commit is contained in:
JordanP 2015-02-06 15:38:18 +01:00
parent dc19b11770
commit 94d1e0f847
8 changed files with 14 additions and 15 deletions

View File

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

View File

@ -82,7 +82,7 @@ _S3_OPTS = [
] ]
class UploadPart: class UploadPart(object):
""" """
The class for the upload part 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.""" """Class describing an image stored in Sheepdog storage."""
def __init__(self, addr, port, name, chunk_size): def __init__(self, addr, port, name, chunk_size):

View File

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

View File

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

View File

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

View File

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

View File

@ -27,9 +27,9 @@ commands = {posargs}
[flake8] [flake8]
# TODO(dmllr): Analyze or fix the warnings blacklisted below # 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 # H301 one import per line
# H404 multi line docstring should start with a summary # 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 = _ builtins = _
exclude = .venv,.git,.tox,dist,doc,etc,*glance_store/locale*,*openstack/common*,*lib/python*,*egg,build exclude = .venv,.git,.tox,dist,doc,etc,*glance_store/locale*,*openstack/common*,*lib/python*,*egg,build