--config-file option of tempest account-generator ignores its the value

Bug #1766354 reported by Martin Kopec
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Undecided
Manik Bindlish

Bug Description

It looks like the issue described here [1] is back.
I used tempest cloned from github from master branch.

$ tempest account-generator --config-file ../path/to/location/tempest.conf accounts.yaml
2018-04-23 21:05:19.258 4653 INFO tempest [-] Using tempest config file /etc/tempest/tempest.conf
Traceback (most recent call last):
  File "/home/centos/tempest/tempest/cmd/account_generator.py", line 285, in take_action
    main(parsed_args)
  File "/home/centos/tempest/tempest/cmd/account_generator.py", line 310, in main
    cred_provider = get_credential_provider(opts)
  File "/home/centos/tempest/tempest/cmd/account_generator.py", line 154, in get_credential_provider
    identity_version, admin_creds=admin_creds))
  File "/home/centos/tempest/tempest/lib/common/dynamic_creds.py", line 106, in __init__
    identity_admin_endpoint_type)
  File "/home/centos/tempest/tempest/lib/common/dynamic_creds.py", line 130, in _get_admin_clients
    self.identity_uri)
  File "/home/centos/tempest/.tox/py27/lib/python2.7/site-packages/debtcollector/removals.py", line 261, in wrapper
    return f(*args, **kwargs)
  File "/home/centos/tempest/tempest/lib/services/clients.py", line 330, in __init__
    'ServiceClients requires a non-empty identity_uri.')
InvalidCredentials: Invalid Credentials
Details: ServiceClients requires a non-empty identity_uri.

However, when I run it from tempest dir and put a tempest.conf to ./etc/, it will work. But it ignores the path given by --config-file argument, because when I tried to change uri address of etc/tempest.conf, that uri was used instead of the uri in the tempest.conf specified by the --config-file argument.

When the etc/tempest.conf is removed, the traceback is showed again.

Steps to reproduce:
1. clone tempest from master and change to the cloned directory
2. install using tox: $ tox -epy27
3. source the .tox/py27/bin/activate environment
4. run account-generator with tempest.conf in a different location. Note: make sure, ./etc/ doesn't contain a tempest.conf
$ tempest account-generator --config-file /path/to/tempest.conf accounts.yaml

Conclusion:
It looks the issue is back/is still there, even though, it was resolved in [1].

[1] https://bugs.launchpad.net/tempest/+bug/1624066

Changed in tempest:
assignee: nobody → Manik Bindlish (manikbindlish)
Revision history for this message
chandan kumar (chkumar246) wrote :

It is reproducable so marking it as confirmed

Changed in tempest:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/577730

Changed in tempest:
assignee: Manik Bindlish (manikbindlish) → Manik Bindlish (manikbindlish19)
status: Confirmed → In Progress
Changed in tempest:
assignee: Manik Bindlish (manikbindlish19) → dharmendra (dharmendra-kushwaha)
Changed in tempest:
assignee: dharmendra (dharmendra-kushwaha) → Manik Bindlish (manikbindlish19)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/577730
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=3e99c04329438a6e9e96101ed1bb4dc842c85612
Submitter: Zuul
Branch: master

commit 3e99c04329438a6e9e96101ed1bb4dc842c85612
Author: Manik Bindlish <email address hidden>
Date: Mon Jun 25 06:22:31 2018 +0000

    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

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tempest 20.0.0

This issue was fixed in the openstack/tempest 20.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.