summaryrefslogtreecommitdiff
path: root/keystoneclient/shell.py
diff options
context:
space:
mode:
authorChristian Berendt <berendt@b1-systems.de>2014-09-21 21:48:46 +0200
committerChristian Berendt <berendt@b1-systems.de>2014-09-21 21:58:48 +0200
commita5bbba4833a6acc802e8a733db6aa307ed8acedf (patch)
tree8a24bc5b5dcd06c07a663fe0954f66bba347e911 /keystoneclient/shell.py
parent0b06683be6d13d21dfffa19be46e1159edb9fce0 (diff)
downloadpython-keystoneclient-a5bbba4833a6acc802e8a733db6aa307ed8acedf.tar.gz
Do not iterate action.choices if it is none
Do not iterate action.choices in the method add_arguments in the class OpenStackHelpFormatter if action.choices is not iterable because it is none. Change-Id: Ie7110adb798326e5856fddfb6a7365c663b84998 Closes-Bug: #1372152
Diffstat (limited to 'keystoneclient/shell.py')
-rw-r--r--keystoneclient/shell.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/keystoneclient/shell.py b/keystoneclient/shell.py
index 61b93e9..ad8d127 100644
--- a/keystoneclient/shell.py
+++ b/keystoneclient/shell.py
@@ -443,6 +443,8 @@ class OpenStackHelpFormatter(argparse.HelpFormatter):
def add_arguments(self, actions):
for action in filter(lambda x: not x.option_strings, actions):
+ if not action.choices:
+ continue
for choice in action.choices:
length = len(choice) + self.INDENT_BEFORE_ARGUMENTS
if(length > self._max_help_position and