blob: e1213dba522add4cf10e443f9665eccd6bcbbb06 [file] [log] [blame]
Matthew Treinish3d468112013-10-24 21:49:14 +00001# Copyright 2013 IBM Corp.
2# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15#
16
17import sys
18
Sean Dague86bd8422013-12-20 09:56:44 -050019import tempest.config
Matthew Treinish3d468112013-10-24 21:49:14 +000020from tempest.openstack.common.config import generator
21
Matthew Treinish6eb05852013-11-26 15:28:12 +000022# NOTE(mtreinish): This hack is needed because of how oslo config is used in
23# tempest. Tempest is run from inside a test runner and so we can't rely on the
24# global CONF object being fully populated when we run a test. (test runners
25# don't init every file for running a test) So to get around that we manually
26# load the config file in tempest for each test class to ensure that every
27# config option is set. However, the tool expects the CONF object to be fully
28# populated when it inits all the files in the project. This just works around
29# the issue by manually loading the config file (which may or may not exist)
30# which will populate all the options before running the generator.
Matthew Treinish3d468112013-10-24 21:49:14 +000031
Sean Dague86bd8422013-12-20 09:56:44 -050032
33if __name__ == "__main__":
Sean Dague2ec4c2c2013-12-22 11:30:06 -050034 CONF = tempest.config.TempestConfigPrivate(False)
Sean Dague86bd8422013-12-20 09:56:44 -050035 generator.generate(sys.argv[1:])