summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glance_store/_drivers/filesystem.py2
-rw-r--r--glance_store/_drivers/swift/store.py8
-rw-r--r--glance_store/tests/base.py2
-rw-r--r--glance_store/tests/utils.py2
-rw-r--r--test-requirements.txt4
-rw-r--r--tests/unit/test_swift_store.py2
-rw-r--r--tox.ini3
7 files changed, 12 insertions, 11 deletions
diff --git a/glance_store/_drivers/filesystem.py b/glance_store/_drivers/filesystem.py
index f91d006..c65e780 100644
--- a/glance_store/_drivers/filesystem.py
+++ b/glance_store/_drivers/filesystem.py
@@ -493,7 +493,7 @@ class Store(glance_store.driver.Store):
:mount_point is path of glance data directory
"""
- #Calculate total available space
+ # Calculate total available space
stvfs_result = os.statvfs(mount_point)
total_available_space = stvfs_result.f_bavail * stvfs_result.f_bsize
return max(0, total_available_space)
diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py
index 56196eb..e49c61e 100644
--- a/glance_store/_drivers/swift/store.py
+++ b/glance_store/_drivers/swift/store.py
@@ -208,13 +208,13 @@ class StoreLocation(location.StoreLocation):
obj = self.obj.strip('/')
if not credentials_included:
- #Used only in case of an add
- #Get the current store from config
+ # Used only in case of an add
+ # Get the current store from config
store = self.conf.glance_store.default_swift_reference
return '%s://%s/%s/%s' % ('swift+config', store, container, obj)
if self.scheme == 'swift+config':
- if self.ssl_enabled == True:
+ if self.ssl_enabled:
self.scheme = 'swift+https'
else:
self.scheme = 'swift+http'
@@ -346,7 +346,7 @@ class StoreLocation(location.StoreLocation):
return self.auth_or_store_url
else:
if self.scheme == 'swift+config':
- if self.ssl_enabled == True:
+ if self.ssl_enabled:
self.scheme = 'swift+https'
else:
self.scheme = 'swift+http'
diff --git a/glance_store/tests/base.py b/glance_store/tests/base.py
index 0f07e35..cb848be 100644
--- a/glance_store/tests/base.py
+++ b/glance_store/tests/base.py
@@ -27,7 +27,7 @@ from glance_store import location
class StoreBaseTest(base.BaseTestCase):
- #NOTE(flaper87): temporary until we
+ # NOTE(flaper87): temporary until we
# can move to a fully-local lib.
# (Swift store's fault)
_CONF = cfg.ConfigOpts()
diff --git a/glance_store/tests/utils.py b/glance_store/tests/utils.py
index b301822..52b0808 100644
--- a/glance_store/tests/utils.py
+++ b/glance_store/tests/utils.py
@@ -19,7 +19,7 @@ import urlparse
def sort_url_by_qs_keys(url):
- #NOTE(kragniz): this only sorts the keys of the query string of a url.
+ # NOTE(kragniz): this only sorts the keys of the query string of a url.
# For example, an input of '/v2/tasks?sort_key=id&sort_dir=asc&limit=10'
# returns '/v2/tasks?limit=10&sort_dir=asc&sort_key=id'. This is to prevent
# non-deterministic ordering of the query string causing problems with unit
diff --git a/test-requirements.txt b/test-requirements.txt
index 779d3a3..abf3509 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -18,7 +18,9 @@ oslotest
sphinx>=1.1.2,!=1.2.0,<1.3
oslosphinx
-### Store specific packages
+#
+# Store specific packages
+#
# For S3 storage backend
boto>=2.12.0,!=2.13.0
diff --git a/tests/unit/test_swift_store.py b/tests/unit/test_swift_store.py
index 84a9b94..e0a1a4c 100644
--- a/tests/unit/test_swift_store.py
+++ b/tests/unit/test_swift_store.py
@@ -247,7 +247,7 @@ class SwiftTests(object):
uri = ("swift://%s:key@auth_address/glance/%s" %
(self.swift_store_user, FAKE_UUID))
self.config(swift_store_multi_tenant=True)
- #NOTE(markwash): ensure the image is found
+ # NOTE(markwash): ensure the image is found
size = backend.get_size_from_backend(uri, context={})
self.assertEqual(size, 5120)
diff --git a/tox.ini b/tox.ini
index b602a0c..98db88d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -28,9 +28,8 @@ commands = {posargs}
[flake8]
# TODO(dmllr): Analyze or fix the warnings blacklisted below
# E711 comparison to None should be 'if cond is not None:'
-# E712 comparison to True should be 'if cond is True:' or 'if cond:'
# H301 one import per line
# H404 multi line docstring should start with a summary
-ignore = E711,E712,H301,H404
+ignore = E711,H301,H404
builtins = _
exclude = .venv,.git,.tox,dist,doc,etc,*glance_store/locale*,*openstack/common*,*lib/python*,*egg,build