Skip to content

Commit a78d75f

Browse files
author
Dean Troyer
committed
Fix PEP8 H405 errors
Change-Id: Id9ea03e7d88148f84bffe1b18b5b4315e6123012
1 parent 8f59524 commit a78d75f

5 files changed

Lines changed: 23 additions & 13 deletions

File tree

‎openstackclient/common/commandmanager.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# under the License.
1414
#
1515

16-
"""Modify Cliff's CommandManager"""
16+
"""Modify cliff.CommandManager"""
1717

1818
import logging
1919
import pkg_resources
@@ -25,9 +25,12 @@
2525

2626

2727
class CommandManager(cliff.commandmanager.CommandManager):
28-
"""Alters Cliff's default CommandManager behaviour to load additional
29-
command groups after initialization.
28+
"""Add additional functionality to cliff.CommandManager
29+
30+
Load additional command groups after initialization
31+
Add *_command_group() methods
3032
"""
33+
3134
def __init__(self, namespace, convert_underscores=True):
3235
self.group_list = []
3336
super(CommandManager, self).__init__(namespace, convert_underscores)

‎openstackclient/common/parseractions.py‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@
1919

2020

2121
class KeyValueAction(argparse.Action):
22-
"""A custom action to parse arguments as key=value pairs.
23-
Ensures that dest is a dict
22+
"""A custom action to parse arguments as key=value pairs
23+
24+
Ensures that ``dest`` is a dict
2425
"""
26+
2527
def __call__(self, parser, namespace, values, option_string=None):
2628
# Make sure we have an empty dict rather than None
2729
if getattr(namespace, self.dest, None) is None:
@@ -35,7 +37,14 @@ def __call__(self, parser, namespace, values, option_string=None):
3537

3638

3739
class RangeAction(argparse.Action):
38-
"""A custom action to parse a single value or a range of values."""
40+
"""A custom action to parse a single value or a range of values
41+
42+
Parses single integer values or a range of integer values delimited
43+
by a colon and returns a tuple of integers:
44+
'4' sets ``dest`` to (4, 4)
45+
'6:9' sets ``dest`` to (6, 9)
46+
"""
47+
3948
def __call__(self, parser, namespace, values, option_string=None):
4049
range = values.split(':')
4150
if len(range) == 0:

‎openstackclient/shell.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,8 @@ def build_option_parser(self, description, version):
330330
return parser
331331

332332
def authenticate_user(self):
333-
"""Make sure the user has provided all of the authentication
334-
info we need.
335-
"""
333+
"""Verify the required authentication credentials are present"""
334+
336335
self.log.debug('validating authentication options')
337336
if self.options.os_token or self.options.os_url:
338337
# Token flow auth takes priority

‎openstackclient/tests/utils.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ def setUp(self):
4141
if tuple(sys.version_info)[0:2] < (2, 7):
4242

4343
def assertIsInstance(self, obj, cls, msg=None):
44-
"""Same as self.assertTrue(isinstance(obj, cls)), with a nicer
45-
default message
46-
"""
44+
"""self.assertTrue(isinstance(obj, cls)), with a nicer message"""
45+
4746
if not isinstance(obj, cls):
4847
standardMsg = '%s is not an instance of %r' % (obj, cls)
4948
self.fail(self._formatMessage(msg, standardMsg))

‎tox.ini‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ commands=
2828
python setup.py build_sphinx
2929

3030
[flake8]
31-
ignore = E126,E202,W602,H302,H402,E265,H305,H307,H405,H904
31+
ignore = E126,E202,W602,H302,H402,E265,H305,H307,H904
3232
show-source = True
3333
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools

0 commit comments

Comments
 (0)