From 6e308a73c55c080ccae2b559d5f7603158d94eb5 Mon Sep 17 00:00:00 2001 From: Jason Zhang <zhesen@nttmcl.com> Date: Tue, 5 Feb 2013 17:51:20 -0800 Subject: [PATCH] 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 f8b3cd5..f95507e 100644 --- a/quantumclient/shell.py +++ b/quantumclient/shell.py @@ -169,7 +169,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 @@ -320,7 +321,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'):