blob: 36e45a548257dd64b823c361b8648daa18432aea [file] [log] [blame]
step6829a9a664c2015-11-30 18:12:25 +00001#!/usr/bin/env python
2
3# Licensed under the Apache License, Version 2.0 (the "License"); you may
4# not use this file except in compliance with the License. You may obtain
5# a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations
13# under the License.
14
15"""
16Utility for listing all currently installed Tempest plugins.
17
18**Usage:** ``tempest list-plugins``.
19"""
20
21from cliff import command
step6829a9a664c2015-11-30 18:12:25 +000022import prettytable
23
24from tempest.test_discover.plugins import TempestTestPluginManager
25
step6829a9a664c2015-11-30 18:12:25 +000026
27class TempestListPlugins(command.Command):
28 def take_action(self, parsed_args):
29 self._list_plugins()
step6829a9a664c2015-11-30 18:12:25 +000030
31 def get_description(self):
32 return 'List all tempest plugins'
33
34 def _list_plugins(self):
35 plugins = TempestTestPluginManager()
36
37 output = prettytable.PrettyTable(["Name", "EntryPoint"])
38 for plugin in plugins.ext_plugins.extensions:
39 output.add_row([
40 plugin.name, plugin.entry_point_target])
41
42 print(output)