提交 45a9828e 编写于 作者: L Lucas Meneghel Rodrigues

avocado: Print config file paths in datadir and list subcommands

It is useful information to the user where the config file
is, to reinforce where avocado is picking the default values.
So add it to the output of `datadir` and `list` subcommands.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 f63ba038
......@@ -15,6 +15,7 @@
from avocado.plugins import plugin
from avocado.core import output
from avocado.core import data_dir
from avocado.settings import settings
class DataDirList(plugin.Plugin):
......@@ -34,6 +35,7 @@ class DataDirList(plugin.Plugin):
def run(self, args):
view = output.View()
view.notify(event="message", msg='Config file path: %s' % settings.config_path)
view.notify(event="message", msg='Avocado Data Directories:')
view.notify(event="message", msg=' base dir ' + data_dir.get_base_dir())
view.notify(event="message", msg=' tests dir ' + data_dir.get_test_dir())
......
......@@ -25,6 +25,7 @@ from avocado.core import output
from avocado.utils import path
from avocado import sysinfo
from avocado import job
from avocado.settings import settings
class TestLister(plugin.Plugin):
......@@ -66,6 +67,7 @@ class TestLister(plugin.Plugin):
blength = clength
test_dirs.append((t.split('.')[0], os.path.join(base_test_dir, t)))
format_string = " %-" + str(blength) + "s %s"
view.notify(event="message", msg='Config file path: %s' % settings.config_path)
view.notify(event='message', msg='Tests dir: %s' % base_test_dir)
if len(test_dirs) > 0:
view.notify(event='message', msg=format_string % ('Alias', 'Path'))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册