Fix the bug of pep8 and building api-guide

`sphinx-build` command is not found in test-env.

To fix pep8, also blacklist the new bandit warning B105, this will
be fixed in a followup.

(cherry picked from commit bf95c37b84)
Change-Id: Ic1b8c3a4bfd67fff082297b881df66ffb9ca2c50
(cherry picked from commit 367453b543)
This commit is contained in:
pengyuesheng 2019-06-25 11:22:40 +08:00 committed by Colleen Murphy
parent 6479e02ce2
commit 9314499b2b
9 changed files with 30 additions and 29 deletions

View File

@ -234,7 +234,7 @@ class SimpleCryptoPlugin(c.CryptoPluginBase):
length_factor = 2 length_factor = 2
if (algorithm.lower() in c.PluginSupportTypes.SYMMETRIC_ALGORITHMS if (algorithm.lower() in c.PluginSupportTypes.SYMMETRIC_ALGORITHMS
and bit_length/length_factor and bit_length / length_factor
in c.PluginSupportTypes.SYMMETRIC_KEY_LENGTHS): in c.PluginSupportTypes.SYMMETRIC_KEY_LENGTHS):
return True return True
elif (algorithm.lower() in c.PluginSupportTypes.ASYMMETRIC_ALGORITHMS elif (algorithm.lower() in c.PluginSupportTypes.ASYMMETRIC_ALGORITHMS

View File

@ -127,7 +127,7 @@ class SecretStoresTestCase(base.TestCase):
stores = json_data['secret-stores'] stores = json_data['secret-stores']
store = stores[len(stores)-1] store = stores[len(stores) - 1]
secret_store_ref = store['secret_store_ref'] secret_store_ref = store['secret_store_ref']
resp = self.ss_behaviors.set_preferred_secret_store(secret_store_ref, resp = self.ss_behaviors.set_preferred_secret_store(secret_store_ref,
user_name=user) user_name=user)
@ -193,7 +193,7 @@ class SecretStoresTestCase(base.TestCase):
stores = json_data['secret-stores'] stores = json_data['secret-stores']
store = stores[len(stores)-1] store = stores[len(stores) - 1]
secret_store_ref = store['secret_store_ref'] secret_store_ref = store['secret_store_ref']
resp = self.ss_behaviors.set_preferred_secret_store(secret_store_ref, resp = self.ss_behaviors.set_preferred_secret_store(secret_store_ref,
user_name=user) user_name=user)

View File

@ -49,7 +49,7 @@ commands =
doc8 {posargs} doc8 {posargs}
flake8 {posargs} flake8 {posargs}
# Run security linter # Run security linter
bandit -r barbican -x tests -n5 bandit -r barbican -x tests -n5 -s B105
[testenv:genconfig] [testenv:genconfig]
basepython = python3 basepython = python3
@ -89,6 +89,7 @@ whitelist_externals = rm
basepython = python3 basepython = python3
# This environment is called from CI scripts to test and publish # This environment is called from CI scripts to test and publish
# the API Guide to developer.openstack.org. # the API Guide to developer.openstack.org.
deps = -r{toxinidir}/doc/requirements.txt
commands = commands =
rm -rf api-guide/build rm -rf api-guide/build
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
@ -158,7 +159,7 @@ exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,contr
[testenv:bandit] [testenv:bandit]
basepython = python3 basepython = python3
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r barbican -x tests -n5 commands = bandit -r barbican -x tests -n5 -s B105
[testenv:bindep] [testenv:bindep]
basepython = python3 basepython = python3