summaryrefslogtreecommitdiff
path: root/openstackclient/shell.py
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2014-10-13 11:13:48 -0500
committerDean Troyer <dtroyer@gmail.com>2014-10-13 23:02:34 -0500
commit897418edca52d9856ef7381a5822fce3bcf8a804 (patch)
treeb6a169ac2b841a4c655f36fa13e47dea05bd9fdb /openstackclient/shell.py
parent36212c43d880d0eaeb3df271cccb314802bf3372 (diff)
downloadpython-openstackclient-897418edca52d9856ef7381a5822fce3bcf8a804.tar.gz
Move plugin stuff to clientmanager
The OSC plugins work by adding an object as an attribute to a ClientManager instance. The initialization and management of thos plugins belongs in clientmanager.py. At this point the only part not moved is the API version dict initialization bcause the timing and connection to the CommandManager initialization. It gets refactored anyway when API discovery becomes operational. Change-Id: If9cb9a0c45a3a577082a5cdbb793769211f20ebb
Diffstat (limited to 'openstackclient/shell.py')
-rw-r--r--openstackclient/shell.py18
1 files changed, 3 insertions, 15 deletions
diff --git a/openstackclient/shell.py b/openstackclient/shell.py
index 626e3f7d..1f9eb32b 100644
--- a/openstackclient/shell.py
+++ b/openstackclient/shell.py
@@ -68,19 +68,6 @@ class OpenStackShell(app.App):
# Assume TLS host certificate verification is enabled
self.verify = True
- # Get list of base modules
- self.ext_modules = clientmanager.get_extension_modules(
- 'openstack.cli.base',
- )
- # Append list of extension modules
- self.ext_modules.extend(clientmanager.get_extension_modules(
- 'openstack.cli.extension',
- ))
-
- # Loop through extensions to get parser additions
- for mod in self.ext_modules:
- self.parser = mod.build_option_parser(self.parser)
-
# NOTE(dtroyer): This hack changes the help action that Cliff
# automatically adds to the parser so we can defer
# its execution until after the api-versioned commands
@@ -170,6 +157,7 @@ class OpenStackShell(app.App):
parser = super(OpenStackShell, self).build_option_parser(
description,
version)
+
# service token auth argument
parser.add_argument(
'--os-url',
@@ -214,7 +202,7 @@ class OpenStackShell(app.App):
help="Print API call timing info",
)
- return parser
+ return clientmanager.build_plugin_option_parser(parser)
def authenticate_user(self):
"""Verify the required authentication credentials are present"""
@@ -332,7 +320,7 @@ class OpenStackShell(app.App):
self.default_domain = self.options.os_default_domain
# Loop through extensions to get API versions
- for mod in self.ext_modules:
+ for mod in clientmanager.PLUGIN_MODULES:
version_opt = getattr(self.options, mod.API_VERSION_OPTION, None)
if version_opt:
api = mod.API_NAME