diff options
-rw-r--r-- | novaclient/shell.py | 2 | ||||
-rw-r--r-- | novaclient/v1_1/shell.py | 10 | ||||
-rwxr-xr-x | run_tests.sh | 20 | ||||
-rw-r--r-- | tools/test-requires | 2 | ||||
-rw-r--r-- | tox.ini | 6 |
5 files changed, 14 insertions, 26 deletions
diff --git a/novaclient/shell.py b/novaclient/shell.py index ed2480aa..b00b2860 100644 --- a/novaclient/shell.py +++ b/novaclient/shell.py @@ -209,7 +209,7 @@ class OpenStackComputeShell(object): parser = NovaClientArgumentParser( prog='nova', description=__doc__.strip(), - epilog='See "nova help COMMAND" '\ + epilog='See "nova help COMMAND" ' 'for help on a specific command.', add_help=False, formatter_class=OpenStackHelpFormatter, diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py index a31ddbbc..46ec6ea5 100644 --- a/novaclient/v1_1/shell.py +++ b/novaclient/v1_1/shell.py @@ -110,7 +110,7 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None): try: userdata = open(args.user_data) except IOError, e: - raise exceptions.CommandError("Can't open '%s': %s" % \ + raise exceptions.CommandError("Can't open '%s': %s" % (args.user_data, e)) else: userdata = None @@ -200,14 +200,14 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None): metavar="<key=value>", action='append', default=[], - help="Record arbitrary key/value metadata to /meta.js "\ + help="Record arbitrary key/value metadata to /meta.js " "on the new server. Can be specified multiple times.") @utils.arg('--file', metavar="<dst-path=src-path>", action='append', dest='files', default=[], - help="Store arbitrary files from <src-path> locally to <dst-path> "\ + help="Store arbitrary files from <src-path> locally to <dst-path> " "on the new server. You may store up to 5 files.") @utils.arg('--key-name', metavar='<key-name>', @@ -1961,7 +1961,7 @@ def do_secgroup_delete_group_rule(cs, args): if (rule.get('ip_protocol') == params.get('ip_protocol') and rule.get('from_port') == params.get('from_port') and rule.get('to_port') == params.get('to_port') and - rule.get('group', {}).get('name') == \ + rule.get('group', {}).get('name') == params.get('group_name')): return cs.security_group_rules.delete(rule['id']) @@ -1985,7 +1985,7 @@ def do_keypair_add(cs, args): with open(os.path.expanduser(pub_key)) as f: pub_key = f.read() except IOError, e: - raise exceptions.CommandError("Can't open or read '%s': %s" % \ + raise exceptions.CommandError("Can't open or read '%s': %s" % (pub_key, e)) keypair = cs.keypairs.create(name, pub_key) diff --git a/run_tests.sh b/run_tests.sh index e33a95d9..e5474c41 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -103,25 +103,11 @@ function copy_subunit_log { function run_pep8 { echo "Running pep8 ..." - srcfiles="novaclient tests" + srcfiles="--exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg ." # Just run PEP8 in current environment # - # NOTE(sirp): W602 (deprecated 3-arg raise) is being ignored for the - # following reasons: - # - # 1. It's needed to preserve traceback information when re-raising - # exceptions; this is needed b/c Eventlet will clear exceptions when - # switching contexts. - # - # 2. There doesn't appear to be an alternative, "pep8-tool" compatible way of doing this - # in Python 2 (in Python 3 `with_traceback` could be used). - # - # 3. Can find no corroborating evidence that this is deprecated in Python 2 - # other than what the PEP8 tool claims. It is deprecated in Python 3, so, - # perhaps the mistake was thinking that the deprecation applied to Python 2 - # as well. - pep8_opts="--ignore=E202,W602 --repeat" - ${wrapper} pep8 ${pep8_opts} ${srcfiles} + ignore="--ignore=E12,E711,E721,E712" + ${wrapper} pep8 ${ignore} --show-source ${srcfiles} } TESTRTESTS="testr run --parallel $testropts" diff --git a/tools/test-requires b/tools/test-requires index 0dacea2a..cae195a3 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -4,7 +4,7 @@ coverage discover fixtures>=0.3.12 mock -pep8==1.1 +pep8==1.3.3 sphinx>=1.1.2 testrepository>=0.0.13 testtools>=0.9.26 @@ -12,8 +12,10 @@ deps = -r{toxinidir}/tools/pip-requires commands = python setup.py testr --testr-args='{posargs}' [testenv:pep8] -deps = pep8==1.1 -commands = pep8 --repeat --show-source novaclient setup.py +deps = pep8==1.3.3 +commands = + pep8 --ignore=E12,E711,E721,E712 --show-source \ + --exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg . [testenv:venv] commands = {posargs} |