Fix PEP8 H405 errors
Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
This commit is contained in:
parent
8f59524c3e
commit
a78d75f290
@ -13,7 +13,7 @@
|
||||
# under the License.
|
||||
#
|
||||
|
||||
"""Modify Cliff's CommandManager"""
|
||||
"""Modify cliff.CommandManager"""
|
||||
|
||||
import logging
|
||||
import pkg_resources
|
||||
@ -25,9 +25,12 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class CommandManager(cliff.commandmanager.CommandManager):
|
||||
"""Alters Cliff's default CommandManager behaviour to load additional
|
||||
command groups after initialization.
|
||||
"""Add additional functionality to cliff.CommandManager
|
||||
|
||||
Load additional command groups after initialization
|
||||
Add *_command_group() methods
|
||||
"""
|
||||
|
||||
def __init__(self, namespace, convert_underscores=True):
|
||||
self.group_list = []
|
||||
super(CommandManager, self).__init__(namespace, convert_underscores)
|
||||
|
@ -19,9 +19,11 @@ import argparse
|
||||
|
||||
|
||||
class KeyValueAction(argparse.Action):
|
||||
"""A custom action to parse arguments as key=value pairs.
|
||||
Ensures that dest is a dict
|
||||
"""A custom action to parse arguments as key=value pairs
|
||||
|
||||
Ensures that ``dest`` is a dict
|
||||
"""
|
||||
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
# Make sure we have an empty dict rather than None
|
||||
if getattr(namespace, self.dest, None) is None:
|
||||
@ -35,7 +37,14 @@ class KeyValueAction(argparse.Action):
|
||||
|
||||
|
||||
class RangeAction(argparse.Action):
|
||||
"""A custom action to parse a single value or a range of values."""
|
||||
"""A custom action to parse a single value or a range of values
|
||||
|
||||
Parses single integer values or a range of integer values delimited
|
||||
by a colon and returns a tuple of integers:
|
||||
'4' sets ``dest`` to (4, 4)
|
||||
'6:9' sets ``dest`` to (6, 9)
|
||||
"""
|
||||
|
||||
def __call__(self, parser, namespace, values, option_string=None):
|
||||
range = values.split(':')
|
||||
if len(range) == 0:
|
||||
|
@ -330,9 +330,8 @@ class OpenStackShell(app.App):
|
||||
return parser
|
||||
|
||||
def authenticate_user(self):
|
||||
"""Make sure the user has provided all of the authentication
|
||||
info we need.
|
||||
"""
|
||||
"""Verify the required authentication credentials are present"""
|
||||
|
||||
self.log.debug('validating authentication options')
|
||||
if self.options.os_token or self.options.os_url:
|
||||
# Token flow auth takes priority
|
||||
|
@ -41,9 +41,8 @@ class TestCase(testtools.TestCase):
|
||||
if tuple(sys.version_info)[0:2] < (2, 7):
|
||||
|
||||
def assertIsInstance(self, obj, cls, msg=None):
|
||||
"""Same as self.assertTrue(isinstance(obj, cls)), with a nicer
|
||||
default message
|
||||
"""
|
||||
"""self.assertTrue(isinstance(obj, cls)), with a nicer message"""
|
||||
|
||||
if not isinstance(obj, cls):
|
||||
standardMsg = '%s is not an instance of %r' % (obj, cls)
|
||||
self.fail(self._formatMessage(msg, standardMsg))
|
||||
|
2
tox.ini
2
tox.ini
@ -28,6 +28,6 @@ commands=
|
||||
python setup.py build_sphinx
|
||||
|
||||
[flake8]
|
||||
ignore = E126,E202,W602,H302,H402,E265,H305,H307,H405,H904
|
||||
ignore = E126,E202,W602,H302,H402,E265,H305,H307,H904
|
||||
show-source = True
|
||||
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools
|
||||
|
Loading…
Reference in New Issue
Block a user