Fix H405 errors in tackerclient code
This Patch fixes all H405 errors and enables this test. [H405] Multi line docstring summary not separated with an empty line Change-Id: I93a9f477f27c259bbfed20ff93105e63d5f6f82c Related-Bug: 1516045
This commit is contained in:
@@ -221,7 +221,9 @@ class CommandError(TackerCLIError):
|
|||||||
|
|
||||||
|
|
||||||
class UnsupportedVersion(TackerCLIError):
|
class UnsupportedVersion(TackerCLIError):
|
||||||
"""Indicates that the user is trying to use an unsupported version of
|
"""Unsupported Version.
|
||||||
|
|
||||||
|
Indicates that the user is trying to use an unsupported version of
|
||||||
the API.
|
the API.
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
@@ -134,11 +134,12 @@ COMMANDS = {'1.0': COMMAND_V1}
|
|||||||
|
|
||||||
|
|
||||||
class HelpAction(argparse.Action):
|
class HelpAction(argparse.Action):
|
||||||
"""Provide a custom action so the -h and --help options
|
"""Provides a custom action for the -h and --help options.
|
||||||
to the main app will print a list of the commands.
|
|
||||||
|
|
||||||
The commands are determined by checking the CommandManager
|
The commands are determined by checking the CommandManager
|
||||||
instance, passed in as the "default" value for the action.
|
instance, passed in as the "default" value for the action.
|
||||||
|
|
||||||
|
:returns: a list of the commands
|
||||||
"""
|
"""
|
||||||
def __call__(self, parser, namespace, values, option_string=None):
|
def __call__(self, parser, namespace, values, option_string=None):
|
||||||
outputs = []
|
outputs = []
|
||||||
@@ -555,7 +556,9 @@ class TackerShell(app.App):
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
def authenticate_user(self):
|
def authenticate_user(self):
|
||||||
"""Make sure the user has provided all of the authentication
|
"""Authentication validation.
|
||||||
|
|
||||||
|
Make sure the user has provided all of the authentication
|
||||||
info we need.
|
info we need.
|
||||||
"""
|
"""
|
||||||
if self.options.os_auth_strategy == 'keystone':
|
if self.options.os_auth_strategy == 'keystone':
|
||||||
|
@@ -26,8 +26,8 @@ API_VERSIONS = {
|
|||||||
|
|
||||||
|
|
||||||
def make_client(instance):
|
def make_client(instance):
|
||||||
"""Returns an tacker client.
|
"""Returns an tacker client."""
|
||||||
"""
|
|
||||||
tacker_client = utils.get_client_class(
|
tacker_client = utils.get_client_class(
|
||||||
API_NAME,
|
API_NAME,
|
||||||
instance._api_version[API_NAME],
|
instance._api_version[API_NAME],
|
||||||
@@ -61,7 +61,8 @@ def make_client(instance):
|
|||||||
|
|
||||||
def Client(api_version, *args, **kwargs):
|
def Client(api_version, *args, **kwargs):
|
||||||
"""Return an tacker client.
|
"""Return an tacker client.
|
||||||
@param api_version: only 1.0 is supported now
|
|
||||||
|
:param api_version: only 1.0 is supported now
|
||||||
"""
|
"""
|
||||||
tacker_client = utils.get_client_class(
|
tacker_client = utils.get_client_class(
|
||||||
API_NAME,
|
API_NAME,
|
||||||
|
@@ -452,8 +452,7 @@ class CreateCommand(TackerCommand, show.ShowOne):
|
|||||||
|
|
||||||
|
|
||||||
class UpdateCommand(TackerCommand):
|
class UpdateCommand(TackerCommand):
|
||||||
"""Update resource's information
|
"""Update resource's information."""
|
||||||
"""
|
|
||||||
|
|
||||||
api = 'servicevm'
|
api = 'servicevm'
|
||||||
resource = None
|
resource = None
|
||||||
|
@@ -127,8 +127,10 @@ class CLITestAuthKeystone(testtools.TestCase):
|
|||||||
self.addCleanup(self.mox.UnsetStubs)
|
self.addCleanup(self.mox.UnsetStubs)
|
||||||
|
|
||||||
def test_reused_token_get_auth_info(self):
|
def test_reused_token_get_auth_info(self):
|
||||||
"""Test that Client.get_auth_info() works even if client was
|
"""Test Client.get_auth_info().
|
||||||
instantiated with predefined token.
|
|
||||||
|
Test that Client.get_auth_info() works even if client was
|
||||||
|
instantiated with predefined token.
|
||||||
"""
|
"""
|
||||||
client_ = client.HTTPClient(username=USERNAME,
|
client_ = client.HTTPClient(username=USERNAME,
|
||||||
tenant_name=TENANT_NAME,
|
tenant_name=TENANT_NAME,
|
||||||
|
@@ -87,8 +87,8 @@ def exception_handler_v10(status_code, error_content):
|
|||||||
|
|
||||||
|
|
||||||
class APIParamsCall(object):
|
class APIParamsCall(object):
|
||||||
"""A Decorator to add support for format and tenant overriding and filters.
|
"""A Decorator to support formating and tenant overriding and filters."""
|
||||||
"""
|
|
||||||
def __init__(self, function):
|
def __init__(self, function):
|
||||||
self.function = function
|
self.function = function
|
||||||
|
|
||||||
|
3
tox.ini
3
tox.ini
@@ -27,8 +27,7 @@ commands = python setup.py testr --coverage --testr-args='{posargs}'
|
|||||||
[flake8]
|
[flake8]
|
||||||
# E125 continuation line does not distinguish itself from next logical line
|
# E125 continuation line does not distinguish itself from next logical line
|
||||||
# H302 import only modules
|
# H302 import only modules
|
||||||
# H405 multi line docstring summary not separated with an empty line
|
|
||||||
# H238 old style class declaration, use new style (inherit from `object`)
|
# H238 old style class declaration, use new style (inherit from `object`)
|
||||||
ignore = E125,H302,H405,H238
|
ignore = E125,H302,H238
|
||||||
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