summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zhang <zhesen@nttmcl.com>2013-02-05 17:51:20 -0800
committerJason Zhang <zhesen@nttmcl.com>2013-02-05 17:59:41 -0800
commit4f3b47d596b9e777828575fe2012ffe2bcbfa7c9 (patch)
treec114b99d2f023780b22879a2fd162fbb169e86ea
parentaa41734347284a2430dc6f32ce4af23ba84d271d (diff)
downloadpython-neutronclient-4f3b47d596b9e777828575fe2012ffe2bcbfa7c9.tar.gz
Stored the quantum commands list to the variable.
By storing the quantum commands list to the variable, the subclass can depend the quantum shell to parse the command. Fixes: bug 1116837 Change-Id: I0a6f3226d326cf015e262e4ddf364d6f9a91d041
-rw-r--r--quantumclient/shell.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/quantumclient/shell.py b/quantumclient/shell.py
index 21f64cf..e9bbb24 100644
--- a/quantumclient/shell.py
+++ b/quantumclient/shell.py
@@ -232,7 +232,8 @@ class QuantumShell(App):
description=__doc__.strip(),
version=VERSION,
command_manager=CommandManager('quantum.cli'), )
- for k, v in COMMANDS[apiversion].items():
+ self.commands = COMMANDS
+ for k, v in self.commands[apiversion].items():
self.command_manager.add_command(k, v)
# This is instantiated in initialize_app() only when using
@@ -383,7 +384,7 @@ class QuantumShell(App):
if arg == 'bash-completion':
self._bash_completion()
return 0
- if arg in COMMANDS[self.api_version]:
+ if arg in self.commands[self.api_version]:
if command_pos == -1:
command_pos = index
elif arg in ('-h', '--help'):