Enables E711,E721,E712 pep8 rules

Updates tox.ini to reduce ignored rules.

Updates novaclient/v1_1/shell.py and
novaclient/v3/shell.py for E712 violation.

Change-Id: Ibfd6a4ed19835e65cc9e27873699c31a801e99a8
This commit is contained in:
Sushil Kumar 2013-12-11 12:02:56 +00:00
parent 06b28391e7
commit 547f357b12
3 changed files with 5 additions and 5 deletions

View File

@ -2126,7 +2126,7 @@ def _get_secgroup(cs, secgroup):
if not six.PY3:
s.name = s.name.encode(encoding)
if secgroup == s.name:
if match_found != False:
if match_found is not False:
msg = ("Multiple security group matches found for name"
" '%s', use an ID to be more specific." % secgroup)
raise exceptions.NoUniqueMatch(msg)
@ -2883,7 +2883,7 @@ def do_coverage_stop(cs, args):
help='Generate XML reports instead of text ones.')
def do_coverage_report(cs, args):
"""Generate coverage report."""
if args.html == True and args.xml == True:
if args.html is True and args.xml is True:
raise exceptions.CommandError("--html and --xml must not be "
"specified together.")
cov = cs.coverage.report(args.filename, xml=args.xml, html=args.html)

View File

@ -1949,7 +1949,7 @@ def _get_secgroup(cs, secgroup):
'UTF-8')
s.name = s.name.encode(encoding)
if secgroup == s.name:
if match_found != False:
if match_found is not False:
msg = ("Multiple security group matches found for name"
" '%s', use an ID to be more specific." % secgroup)
raise exceptions.NoUniqueMatch(msg)
@ -2706,7 +2706,7 @@ def do_coverage_stop(cs, args):
help='Generate XML reports instead of text ones.')
def do_coverage_report(cs, args):
"""Generate coverage report."""
if args.html == True and args.xml == True:
if args.html is True and args.xml is True:
raise exceptions.CommandError("--html and --xml must not be "
"specified together.")
cov = cs.coverage.report(args.filename, xml=args.xml, html=args.html)

View File

@ -28,6 +28,6 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
downloadcache = ~/cache/pip
[flake8]
ignore = E12,E711,E721,E712,F841,F811,F821,H302,H306,H403,H404
ignore = E12,F841,F811,F821,H302,H306,H403,H404
show-source = True
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build