From 8204858d3858b29dc6bb34a62d7991e90be9fef2 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 28 Aug 2014 10:33:16 -0400 Subject: [PATCH] Update hacking ignore list and pep8 clean This commit updates the ignore list to be more consistent with the set of rules used in tempest. Additionally it fixes all the pep8 issues which were failing. --- openstack-common.conf | 5 ++++- requirements.txt | 3 ++- setup.py | 2 +- tempest_lib/__init__.py | 2 +- tempest_lib/cli/output_parser.py | 7 +++---- tempest_lib/exceptions.py | 4 ++-- tox.ini | 7 +++++-- 7 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openstack-common.conf b/openstack-common.conf index 208d016..13f6206 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -1,6 +1,9 @@ [DEFAULT] # The list of modules to copy from oslo-incubator.git +module=log +module=versionutils + # The base module to hold the copy of openstack.common -base=tempest_lib \ No newline at end of file +base=tempest_lib diff --git a/requirements.txt b/requirements.txt index 9fab56e..e6eda85 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pbr>=0.6,!=0.7,<1.0 -Babel>=1.3 \ No newline at end of file +Babel>=1.3 +fixtures diff --git a/setup.py b/setup.py index 7eeb36b..70c2b3f 100755 --- a/setup.py +++ b/setup.py @@ -19,4 +19,4 @@ import setuptools setuptools.setup( setup_requires=['pbr'], - pbr=True) \ No newline at end of file + pbr=True) diff --git a/tempest_lib/__init__.py b/tempest_lib/__init__.py index 57fabb1..a16165a 100644 --- a/tempest_lib/__init__.py +++ b/tempest_lib/__init__.py @@ -16,4 +16,4 @@ import pbr.version __version__ = pbr.version.VersionInfo( - 'tempest_lib').version_string() \ No newline at end of file + 'tempest_lib').version_string() diff --git a/tempest_lib/cli/output_parser.py b/tempest_lib/cli/output_parser.py index 80234a3..58d88c5 100644 --- a/tempest_lib/cli/output_parser.py +++ b/tempest_lib/cli/output_parser.py @@ -36,8 +36,8 @@ def details_multiple(output_lines, with_label=False): items = [] tables_ = tables(output_lines) for table_ in tables_: - if 'Property' not in table_['headers'] \ - or 'Value' not in table_['headers']: + if ('Property' not in table_['headers'] + or 'Value' not in table_['headers']): raise exceptions.InvalidStructure() item = {} for value in table_['values']: @@ -55,8 +55,7 @@ def details(output_lines, with_label=False): def listing(output_lines): - """Return list of dicts with basic item info parsed from cli output. - """ + """Return list of dicts with basic item info parsed from cli output.""" items = [] table_ = table(output_lines) diff --git a/tempest_lib/exceptions.py b/tempest_lib/exceptions.py index cc31fad..0c5a1ef 100644 --- a/tempest_lib/exceptions.py +++ b/tempest_lib/exceptions.py @@ -17,13 +17,13 @@ import testtools class TempestException(Exception): - """ - Base Tempest Exception + """Base Tempest Exception. To correctly use this class, inherit from it and define a 'message' property. That message will get printf'd with the keyword arguments provided to the constructor. """ + message = "An unknown exception occurred" def __init__(self, *args, **kwargs): diff --git a/tox.ini b/tox.ini index 5cf18e8..67d3d19 100644 --- a/tox.ini +++ b/tox.ini @@ -27,8 +27,11 @@ commands = python setup.py build_sphinx [flake8] # H803 skipped on purpose per list discussion. # E123, E125 skipped as they are invalid PEP-8. - +# H402 skipped because some docstrings aren't sentences +# E123 skipped because it is ignored by default in the default pep8 +# E129 skipped because it is too limiting when combined with other rules +# H305 skipped because it is inconsistent between python versions show-source = True -ignore = E123,E125,H803 +ignore = E123,E125,H803,H402,E123,E129,H305 builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build