Fix stable gate

This is a combination of 2 commits.

===

Fix pep8 job

New flake8 came out with new & improved rules. Ignore E741; it would be
too much churn. Fix the rest.

(cherry picked from commit 0fd23ee546)

===

Use ensure-pip role

Hopefully this will fix the currently-broken probe test gate?

Depends-On: https://review.opendev.org/#/c/736070/
(cherry picked from commit 51a587ed8d)

===

Change-Id: I127769c60e99880830a9d891ebc5b9685f74c129
This commit is contained in:
Tim Burke 2020-05-13 00:24:08 -07:00
parent 16f6af9c97
commit 5b1d50866e
5 changed files with 7 additions and 5 deletions

View File

@ -1658,7 +1658,7 @@ def main(arguments=None):
print(msg)
exit(EXIT_ERROR)
except (exceptions.FileNotFoundError, exceptions.PermissionError) as e:
if len(argv) < 3 or argv[2] not in('create', 'write_builder'):
if len(argv) < 3 or argv[2] not in ('create', 'write_builder'):
print(e)
exit(EXIT_ERROR)
except Exception as e:

View File

@ -2113,7 +2113,7 @@ class TestRingBuilder(unittest.TestCase):
orig_rb = ring.RingBuilder(8, 3, 1)
copy_rb = ring.RingBuilder(8, 3, 1)
copy_rb.copy_from(orig_rb)
for rb in(orig_rb, copy_rb):
for rb in (orig_rb, copy_rb):
with self.assertRaises(AttributeError) as cm:
rb.id
self.assertIn('id attribute has not been initialised',

View File

@ -1289,7 +1289,7 @@ class TestDatabaseBroker(unittest.TestCase):
for c in range(MAX_META_COUNT):
key = 'X-Account-Meta-F{0}'.format(c)
metadata[key] = ('B', normalize_timestamp(1))
key = 'X-Account-Meta-Foo'.format(c)
key = 'X-Account-Meta-Foo'
metadata[key] = ('', normalize_timestamp(1))
self.assertIsNone(DatabaseBroker.validate_metadata(metadata))

View File

@ -14,12 +14,13 @@
# limitations under the License.
- hosts: all
become: true
roles:
- ensure-pip
tasks:
- name: installing dependencies
yum: name={{ item }} state=present
with_items:
- python-pyeclib
- python-pip
- python-nose
- python-swiftclient

View File

@ -131,10 +131,11 @@ commands = bandit -c bandit.yaml -r swift -n 5
# changes to enable:
# E402: module level import not at top of file
# E731 do not assign a lambda expression, use a def
# E741 ambiguous variable name
# Swift team needs to decide if they want to enable either of these:
# W503: line break before binary operator
# W504: line break after binary operator
ignore = H101,H202,H301,H306,H404,H405,H501,W503,W504,E402,E731
ignore = H101,H202,H301,H306,H404,H405,H501,W503,W504,E402,E731,E741
exclude = .venv,.tox,dist,*egg
filename = *.py,bin/*
show-source = True