blob: 5f6b3e650cda6645172455f9a03835103a4e5996 [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
22from oslo_log import log as logging
23import prettytable
24
25from tempest.test_discover.plugins import TempestTestPluginManager
26
27LOG = logging.getLogger(__name__)
28
29
30class TempestListPlugins(command.Command):
31 def take_action(self, parsed_args):
32 self._list_plugins()
step6829a9a664c2015-11-30 18:12:25 +000033
34 def get_description(self):
35 return 'List all tempest plugins'
36
37 def _list_plugins(self):
38 plugins = TempestTestPluginManager()
39
40 output = prettytable.PrettyTable(["Name", "EntryPoint"])
41 for plugin in plugins.ext_plugins.extensions:
42 output.add_row([
43 plugin.name, plugin.entry_point_target])
44
45 print(output)