Avishek Duta | dd80833 | 2018-09-20 13:27:10 -0500 | [diff] [blame^] | 1 | # Copyright 2016 AT&T 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 | from oslo_config import cfg |
| 16 | |
| 17 | service_available_group = cfg.OptGroup(name="service_available", |
| 18 | title="Available OpenStack Services") |
| 19 | |
| 20 | ServiceAvailableGroup = [ |
| 21 | cfg.BoolOpt("contrail", |
| 22 | default=True, |
| 23 | help="Whether or not contrail is expected to be available."), |
| 24 | ] |
| 25 | |
| 26 | sdn_group = cfg.OptGroup(name='sdn', |
| 27 | title='SDN service options') |
| 28 | |
| 29 | SDNGroup = [ |
| 30 | cfg.StrOpt('endpoint_type', |
| 31 | default='publicURL', |
| 32 | choices=['public', 'admin', 'internal', |
| 33 | 'publicURL', 'adminURL', 'internalURL'], |
| 34 | help="The endpoint type to use for the SDN service"), |
| 35 | cfg.StrOpt('catalog_type', |
| 36 | default='sdn-l-config', |
| 37 | help="Catalog type of the SDN service"), |
| 38 | ] |
| 39 | |
| 40 | tungsten_log_group = cfg.OptGroup( |
| 41 | name='tungsten_log', title='tungsten Tempest Logging Options') |
| 42 | |
| 43 | TungstenLogGroup = [ |
| 44 | cfg.BoolOpt('enable_reporting', |
| 45 | default=False, |
| 46 | help="Enables reporting on RBAC expected and actual test " |
| 47 | "results for each tungstenTempest test"), |
| 48 | cfg.StrOpt('report_log_name', |
| 49 | default='tungsten.log', |
| 50 | help="Name of file where output from 'enable_reporting' is " |
| 51 | "logged. Note that this file is recreated on each " |
| 52 | "invocation of tungsten_tempest"), |
| 53 | cfg.StrOpt('report_log_path', |
| 54 | default='.', |
| 55 | help="Path (relative or absolute) where the output from " |
| 56 | "'enable_reporting' is logged. This is combined with" |
| 57 | "report_log_name to generate the full path."), |
| 58 | ] |
| 59 | |
| 60 | |
| 61 | def list_opts(): |
| 62 | """Return a list of oslo.config options available. |
| 63 | |
| 64 | The purpose of this is to allow tools like the Oslo sample config file |
| 65 | generator to discover the options exposed to users. |
| 66 | """ |
| 67 | opt_list = [ |
| 68 | (service_available_group, ServiceAvailableGroup), |
| 69 | (sdn_group, SDNGroup), |
| 70 | (tungsten_log_group, TungstenLogGroup) |
| 71 | |
| 72 | ] |
| 73 | return opt_list |