summaryrefslogtreecommitdiff
path: root/troveclient/shell.py
diff options
context:
space:
mode:
authorTin Lam <tl3438@att.com>2016-04-12 19:03:04 -0500
committerTin Lam <tl3438@att.com>2016-04-12 19:09:21 -0500
commit5d8412432b999b4d96c4f63825c84338cdd34d35 (patch)
tree806ec8b06f644a8b930836c1e2ee6afe8c611148 /troveclient/shell.py
parent4955d07f036de6c0d31988c4cd14afab72054c3c (diff)
downloadpython-troveclient-5d8412432b999b4d96c4f63825c84338cdd34d35.tar.gz
Added check to prevent adding argument without help string
Added addition check in add_argument() to ensure it has help message is always present per Amrith's suggestion in this review: https://review.openstack.org/#/c/261425/ Change-Id: Ic6486570d4beb138fdcd0c4e700ccc8d734d3e5e Closes-Bug: #1530195
Diffstat (limited to 'troveclient/shell.py')
-rw-r--r--troveclient/shell.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/troveclient/shell.py b/troveclient/shell.py
index 1de4db8..cc7a00b 100644
--- a/troveclient/shell.py
+++ b/troveclient/shell.py
@@ -66,6 +66,12 @@ class TroveClientArgumentParser(argparse.ArgumentParser):
def __init__(self, *args, **kwargs):
super(TroveClientArgumentParser, self).__init__(*args, **kwargs)
+ def add_argument(self, *args, **kwargs):
+ if kwargs.get('help') is None:
+ raise Exception(_("An argument '%s' was specified without help.")
+ % args[0])
+ super(TroveClientArgumentParser, self).add_argument(*args, **kwargs)
+
def error(self, message):
"""error(message: string)