From 4f3b47d596b9e777828575fe2012ffe2bcbfa7c9 Mon Sep 17 00:00:00 2001 From: Jason Zhang Date: Tue, 5 Feb 2013 17:51:20 -0800 Subject: 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 --- quantumclient/shell.py | 5 +++-- 1 file 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'): -- cgit v1.2.1