Browse Source

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
Sushil Kumar 5 years ago
parent
commit
547f357b12
3 changed files with 5 additions and 5 deletions
  1. 2
    2
      novaclient/v1_1/shell.py
  2. 2
    2
      novaclient/v3/shell.py
  3. 1
    1
      tox.ini

+ 2
- 2
novaclient/v1_1/shell.py View File

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

+ 2
- 2
novaclient/v3/shell.py View File

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

+ 1
- 1
tox.ini View File

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

Loading…
Cancel
Save