From 45a9828e5f7021a8e5de44ff593dd71e5a9c02c7 Mon Sep 17 00:00:00 2001 From: Lucas Meneghel Rodrigues Date: Wed, 3 Dec 2014 17:17:52 -0200 Subject: [PATCH] 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: Lucas Meneghel Rodrigues --- avocado/plugins/datadir.py | 2 ++ avocado/plugins/runner.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/avocado/plugins/datadir.py b/avocado/plugins/datadir.py index 26cdb506..fbbb86f3 100644 --- a/avocado/plugins/datadir.py +++ b/avocado/plugins/datadir.py @@ -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()) diff --git a/avocado/plugins/runner.py b/avocado/plugins/runner.py index 68d2493b..2296dc59 100644 --- a/avocado/plugins/runner.py +++ b/avocado/plugins/runner.py @@ -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')) -- GitLab