From 3e99c04329438a6e9e96101ed1bb4dc842c85612 Mon Sep 17 00:00:00 2001 From: Manik Bindlish Date: Mon, 25 Jun 2018 06:22:31 +0000 Subject: [PATCH] Fixing ignored value of --config parameter in tempest account-generator Config parameter of tempest account-generator was ignored. Instead of that default location of config file were used. If tempest.conf file doesn't exist on default location then command was failing. It never used the config file value from command line. Command was running successfully only when running from tempest directory or tempest.conf exist in current directory Test cases from below patches are relevant for this patch: 1.) https://review.openstack.org/#/c/608878 *test_account_generator_no_config_file* 2.) https://review.openstack.org/#/c/620920 *test_account_generator_exist_config_file* Partially-Implements: blueprint tempest-cli-unit-test-coverage Change-Id: Ic8dcaff920e5cdfb9a9457ff3a3137c225622409 Closes-Bug: #1766354 --- tempest/cmd/account_generator.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tempest/cmd/account_generator.py b/tempest/cmd/account_generator.py index 9be8ee260f..ce91825581 100755 --- a/tempest/cmd/account_generator.py +++ b/tempest/cmd/account_generator.py @@ -293,13 +293,16 @@ class TempestAccountGenerator(command.Command): def main(opts=None): - setup_logging() + log_warning = False if not opts: - LOG.warning("Use of: 'tempest-account-generator' is deprecated, " - "please use: 'tempest account-generator'") + log_warning = True opts = get_options() if opts.config_file: config.CONF.set_config_path(opts.config_file) + setup_logging() + if log_warning: + LOG.warning("Use of: 'tempest-account-generator' is deprecated, " + "please use: 'tempest account-generator'") if opts.os_tenant_name: LOG.warning("'os-tenant-name' and 'OS_TENANT_NAME' are both " "deprecated, please use 'os-project-name' or "