summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-06-27 21:41:31 +0000
committerGerrit Code Review <review@openstack.org>2014-06-27 21:41:31 +0000
commit63b1c060244bb08d59ef9df8e26d901e98bf3bf8 (patch)
tree5c9eee3754507c3cb3eaa7c9340bf7cbff47418e
parent42765a15f3b4f02b6fc59dd54e5e0a3dab7105f5 (diff)
parenta78d75f290278501b5d8130dc58420952a13e1a1 (diff)
downloadpython-openstackclient-63b1c060244bb08d59ef9df8e26d901e98bf3bf8.tar.gz
Merge "Fix PEP8 H405 errors"
-rw-r--r--openstackclient/common/commandmanager.py9
-rw-r--r--openstackclient/common/parseractions.py15
-rw-r--r--openstackclient/shell.py5
-rw-r--r--openstackclient/tests/utils.py5
-rw-r--r--tox.ini2
5 files changed, 23 insertions, 13 deletions
diff --git a/openstackclient/common/commandmanager.py b/openstackclient/common/commandmanager.py
index aa238a23..08710c77 100644
--- a/openstackclient/common/commandmanager.py
+++ b/openstackclient/common/commandmanager.py
@@ -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)
diff --git a/openstackclient/common/parseractions.py b/openstackclient/common/parseractions.py
index 644472d8..8f6008e2 100644
--- a/openstackclient/common/parseractions.py
+++ b/openstackclient/common/parseractions.py
@@ -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:
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 67eaca55..6aae1a68 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -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
diff --git a/openstackclient/tests/utils.py b/openstackclient/tests/utils.py
index ff7d8a33..48385d13 100644
--- a/openstackclient/tests/utils.py
+++ b/openstackclient/tests/utils.py
@@ -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))
diff --git a/tox.ini b/tox.ini
index c646457f..95f00cdf 100644
--- a/tox.ini
+++ b/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