Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 1 | # 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 | |
| 17 | import sys |
| 18 | |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 19 | import tempest.config |
Matthew Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 20 | from tempest.openstack.common.config import generator |
| 21 | |
Matthew Treinish | 6eb0585 | 2013-11-26 15:28:12 +0000 | [diff] [blame] | 22 | # 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 Treinish | 3d46811 | 2013-10-24 21:49:14 +0000 | [diff] [blame] | 31 | |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 32 | |
| 33 | if __name__ == "__main__": |
Sean Dague | 2ec4c2c | 2013-12-22 11:30:06 -0500 | [diff] [blame] | 34 | CONF = tempest.config.TempestConfigPrivate(False) |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 35 | generator.generate(sys.argv[1:]) |