openstackclient启动顺序
在openstackclient.shell:main
openstackclient.shell.OpenStackShell.init()
osc_lib.shell.OpenStackShell.__init__()
cliff.app.App.__init__()
# 加载parse
build_plugin_option_parser()
cliff.app.App.build_plugin_option_parser()
parse = cliff._argparse.ArgumentParser()
osc_lib.shell.OpenStackShell.build_plugin_option_parser()
pasre.add base config options
openstackclient.shell.OpenStackShell.build_plugin_option_parser()
openstackclient.common.clientmanager.build_plugin_option_parser(parser)
# 创建基础的command manager
commandmanager("openstack.cli")
openstackclient.shell.OpenStackShell.run(argv)
osc_lib.shell.OpenStackShell.run(argv)
self.commanf_options = argv
cliff.app.run(argv)
# 初始化app加载命令
osc_lib.shell.OpenStackShell.initialize_app()
# 加载plugin
openstackclient.shell.OpenStackShell.__load_plugins()
openstackclient.common.clientmanager.PLUGIN_MODULES
get_plugin_models("openstack.cli.base")
get_plugin_models("openstack.cli.extionsion")
# 加载指定版本的command
for mod in PLUGIN_MODULES:
cmd_group = f"openstack.{mod.API_NAME}.v{api_version}"
self.command_manager.add_command_group(cmd_group)
# 加载拓展命令
openstackclient.shell.OpenStackShell.__load_commands()
# 设置logging
self.configure_logging()
osc_lib.shell.OpenStackShell.configure_logging()
cliff.app.shell.OpenStackShell.run_subcommand() or interact()