Fix E265, E129, E113 errors in tackerclient code
This Patch fixes all E265, E129, E113 errors and enables this test for all new patches to tacker. [E265] block comment should start with '# ' [E129] visually indented line with same indent as next logical line [E113] unexpected indentation Change-Id: I708dd9e0c4f3edb0b52a865578aceace726d1c2e Related-Bug: 1516045
This commit is contained in:
@@ -263,7 +263,7 @@ def parse_args_to_dict(values_specs):
|
|||||||
# All others are value items
|
# All others are value items
|
||||||
# Make sure '--' occurs first and allow minus value
|
# Make sure '--' occurs first and allow minus value
|
||||||
if (not current_item or '=' in current_item or
|
if (not current_item or '=' in current_item or
|
||||||
_item.startswith('-') and not is_number(_item)):
|
_item.startswith('-') and not is_number(_item)):
|
||||||
raise exceptions.CommandError(
|
raise exceptions.CommandError(
|
||||||
_("Invalid values_specs %s") % ' '.join(values_specs))
|
_("Invalid values_specs %s") % ' '.join(values_specs))
|
||||||
_value_number += 1
|
_value_number += 1
|
||||||
@@ -308,7 +308,7 @@ def _merge_args(qCmd, parsed_args, _extra_values, value_specs):
|
|||||||
if isinstance(arg_value, list):
|
if isinstance(arg_value, list):
|
||||||
if value and isinstance(value, list):
|
if value and isinstance(value, list):
|
||||||
if (not arg_value or
|
if (not arg_value or
|
||||||
type(arg_value[0]) == type(value[0])):
|
type(arg_value[0]) == type(value[0])):
|
||||||
arg_value.extend(value)
|
arg_value.extend(value)
|
||||||
_extra_values.pop(key)
|
_extra_values.pop(key)
|
||||||
|
|
||||||
@@ -362,8 +362,8 @@ class TackerCommand(command.OpenStackCommand):
|
|||||||
# NOTE(markmcclain): This is no longer supported in cliff version 1.5.2
|
# NOTE(markmcclain): This is no longer supported in cliff version 1.5.2
|
||||||
# see https://bugs.launchpad.net/python-tackerclient/+bug/1265926
|
# see https://bugs.launchpad.net/python-tackerclient/+bug/1265926
|
||||||
|
|
||||||
#if hasattr(self, 'formatters'):
|
# if hasattr(self, 'formatters'):
|
||||||
#self.formatters['table'] = TableFormater()
|
# self.formatters['table'] = TableFormater()
|
||||||
|
|
||||||
def get_client(self):
|
def get_client(self):
|
||||||
return self.app.client_manager.tacker
|
return self.app.client_manager.tacker
|
||||||
|
@@ -118,7 +118,7 @@ class ShellTest(testtools.TestCase):
|
|||||||
'either --os-url or env[OS_URL]', stderr.strip())
|
'either --os-url or env[OS_URL]', stderr.strip())
|
||||||
|
|
||||||
def test_auth(self):
|
def test_auth(self):
|
||||||
#import pdb; pdb.set_trace()
|
# import pdb; pdb.set_trace()
|
||||||
tacker_shell = openstack_shell.TackerShell('1.0')
|
tacker_shell = openstack_shell.TackerShell('1.0')
|
||||||
self.addCleanup(self.mox.UnsetStubs)
|
self.addCleanup(self.mox.UnsetStubs)
|
||||||
self.mox.StubOutWithMock(clientmanager.ClientManager, '__init__')
|
self.mox.StubOutWithMock(clientmanager.ClientManager, '__init__')
|
||||||
|
5
tox.ini
5
tox.ini
@@ -29,10 +29,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||||||
# H302 import only modules
|
# H302 import only modules
|
||||||
# H105 Don't use author tags
|
# H105 Don't use author tags
|
||||||
# H405 multi line docstring summary not separated with an empty line
|
# H405 multi line docstring summary not separated with an empty line
|
||||||
# E265 block comment should start with '# '
|
|
||||||
# H238 old style class declaration, use new style (inherit from `object`)
|
# H238 old style class declaration, use new style (inherit from `object`)
|
||||||
# E129 visually indented line with same indent as next logical line
|
ignore = E125,H302,H105,H405,H238
|
||||||
# E113 unexpected indentation
|
|
||||||
ignore = E125,H302,H105,H405,E265,H238,E129,E113
|
|
||||||
show-source = true
|
show-source = true
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools
|
||||||
|
Reference in New Issue
Block a user