Exception generated when setting up a local working directory following the Quickstart guide

Bug #1490670 reported by Castulo J. Martinez
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
tempest
Fix Released
Critical
David Paterson

Bug Description

I was following the steps in the Quickstart guide to get Tempest ready to work (http://docs.openstack.org/developer/tempest/overview.html#quickstart) and I am getting an exception.

Steps to recreate:

1) Clone the tempest repository into your machine
2) Install a virtual environment and activate it.
3) Run the following command to install tempest: "pip instal tempest/"
4) Run the following command to setup a local working directory for Tempest: "tempest init cloud-01"

Expected Results:

- A new directory called "cloud-01" is created.
- The recently created directory should include some other subdirectories within it, like etc, logs, tempest_lock, among others
- Within the /cloud-01/etc a whole bunch of sample configuration files should be created, including one called tempest.conf.sample

Actual results

- After running the command the following exception is shown:
(tempest)cjmarti2@gmw-cjmarti2:~$ tempest init cloud-01
Traceback (most recent call last):
  File "/home/cjmarti2/.virtualenvs/tempest/bin/oslo-config-generator", line 11, in <module>
    sys.exit(main())
  File "/home/cjmarti2/.virtualenvs/tempest/local/lib/python2.7/site-packages/oslo_config/generator.py", line 282, in main
    conf(args, version=version)
  File "/home/cjmarti2/.virtualenvs/tempest/local/lib/python2.7/site-packages/oslo_config/cfg.py", line 1883, in __call__
    raise ConfigFilesNotFoundError(self._namespace._files_not_found)
oslo_config.cfg.ConfigFilesNotFoundError: Failed to find some config files: /home/cjmarti2/cloud-01/tools/config/config-generator.tempest.conf
 - The directories and files are correctly created except for the tempest.conf file, or tempest.conf.sample. There is one tempest.cof file that gets created but it is emtpy.

summary: - Exception generated when setting up a local working directory
+ Exception generated when setting up a local working directory following
+ the Quickstart guide
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

>- /home/cjmarti2/cloud-01/tools/config/config-generator.tempest.conf

it should run "tools/config/config-generator.tempest.conf" from tempest repo not from local_dir - https://github.com/openstack/tempest/blob/master/tempest/cmd/init.py#L105

Changed in tempest:
status: New → Confirmed
Changed in tempest:
assignee: nobody → Castulo J. Martinez (castulo-martinez)
Revision history for this message
Blake Devcich (frayedknot) wrote :

I've also ran into this issue in a devstack environment. It appears that /etc/tempest/ doesn't exist, which may lead the exception.

Steps to reproduce:
1. stack.sh with local.conf:
[[local|localrc]]
ADMIN_PASSWORD=password
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9080d50
#FIXED_RANGE=172.31.1.0/24
#FLOATING_RANGE=192.168.20.0/25
#HOST_IP=10.3.4.5
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-meta
RECLONE=yes
2. pip install tempest
3. ls /etc/tempest -> shows nothing
4. tempest init cloud-01
Traceback (most recent call last):
  File "/usr/local/bin/oslo-config-generator", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/oslo_config/generator.py", line 282, in main
    conf(args, version=version)
  File "/usr/local/lib/python2.7/dist-packages/oslo_config/cfg.py", line 1883, in __call__
    raise ConfigFilesNotFoundError(self._namespace._files_not_found)
oslo_config.cfg.ConfigFilesNotFoundError: Failed to find some config files: /home/vagrant/cloud-01/tools/config/config-generator.tempest.conf

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/219589

Changed in tempest:
assignee: Castulo J. Martinez (castulo-martinez) → Ghanshyam Mann (ghanshyammann)
status: Confirmed → In Progress
Revision history for this message
Castulo J. Martinez (castulo-martinez) wrote :

I am a noobie, this was the first bug I was goin to fix and I am not that familiar with the community practices yet, but I didn't know you cuold just grab a bug that is already assigned to someone and reassign it to someone else without talking with the original owner first... it kind of seems to rude to me. Mostly because that means the original owner just wasted time writting code and testing only for having someone else submitting the fix in the end. But well, lesson learned, from now on I know that is a valid practice in the community.

Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

@Castulo

Ahh my bad i did not see you assigned the bug and working on that (started patch when it was not assigned and submitted next day without checking assignee :( ). Valid practice is that assignee should be informed first if someone else if fixing that.

I am sorry for inconvenience caused to you. I am ok if you can submit your fix (even it is same) i can take back mine that's not big deal.

Please let me know your plan.

And Thanks for your time and interest on contribution. How about taking more bugs (may be those in confirmed state) we can help whenever you need.

Revision history for this message
Castulo J. Martinez (castulo-martinez) wrote :

@Ghanshyam

Thank you very much for your reply, it is good to know that it was just a confusion and not because is the way the community behaves. I really appreciate you took the time to explain things :)

And about your fix, don't worry, I'm perfectly fine with your submitted patch, there will be plenty of other bugs where I can try to help out.

Thanks again for your kind respone.
Cheers!

Changed in tempest:
assignee: Ghanshyam Mann (ghanshyammann) → David Paterson (davpat2112)
Changed in tempest:
importance: Undecided → Critical
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tempest (master)

Reviewed: https://review.openstack.org/224338
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=0bf52d497bebb3a0b393f2a8862eaf5161d76d79
Submitter: Jenkins
Branch: master

commit 0bf52d497bebb3a0b393f2a8862eaf5161d76d79
Author: David Paterson <email address hidden>
Date: Mon Apr 13 21:55:58 2015 -0400

    Fix init command

    Init command was not working properly as it could not locate the
    configuration sample file.
    Steps taken:
    - Move config-generator.tempest.conf to etc so it will be installed
    with pbr.
    - Update all files with new path to config-generator-tempest.conf as
    needed.
    - Refactor init command so if it detects we are not in a virtual
    environment, try to find the global config directory /etc/tempest.
    If that fails fallback to [sys.prefix]/etc/tempest.

    Closes-Bug: #1491058
    Closes-Bug: #1490670
    Change-Id: I960bc711ff78ac2b0441ef63dff8ec4fb268fd3a

Changed in tempest:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to tempest (master)

Reviewed: https://review.openstack.org/219589
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=f00108466939487435619a03e2c9f6011e16bcfd
Submitter: Jenkins
Branch: master

commit f00108466939487435619a03e2c9f6011e16bcfd
Author: ghanshyam <email address hidden>
Date: Fri Oct 9 15:46:41 2015 +0900

    Add unit test for init.py->generate_sample_config()

    This commit adds unit tests for generate_sample_config
    method of Tempest init cmd.

    Related-Bug: #1490670

    Change-Id: I5f4b87ebe79f0c937ee61bbc46eec2c7dfe28686

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.