generate configuration via oslo

add a sample configuration file and a tox environment to generate the
configuration files.

Change-Id: I96c3955b9e320939a87a6d6def8dc98604405bc3
This commit is contained in:
Alvaro Lopez Garcia 2015-11-26 13:50:48 +01:00
parent f70d7ff69b
commit 15892da8a3
4 changed files with 42 additions and 0 deletions

15
etc/ooi.conf.sample Normal file
View File

@ -0,0 +1,15 @@
[DEFAULT]
#
# From ooi
#
# The IP address on which the OCCI (ooi) API will listen. (string value)
#ooi_listen = 0.0.0.0
# The port on which the OCCI (ooi) API will listen. (integer value)
#ooi_listen_port = 8787
# Number of workers for OCCI (ooi) API service. The default will be equal to
# the number of CPUs available. (integer value)
#ooi_workers = <None>

21
ooi/opts.py Normal file
View File

@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Spanish National Research Council (CSIC)
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from ooi import wsgi
def list_opts():
return [("DEFAULT", wsgi.occi_opts)]

View File

@ -47,6 +47,8 @@ output_file = ooi/locale/ooi.pot
[entry_points]
paste.filter_factory =
ooi = ooi.wsgi:OCCIMiddleware.factory
oslo.config.opts =
ooi = ooi.opts:list_opts
[pbr]
# Have pbr generate the module indexes like sphinx autodoc

View File

@ -30,6 +30,10 @@ deps = coveralls
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:genconfig]
commands = oslo-config-generator --output-file etc/ooi.conf.sample \
--namespace ooi --wrap-width 79
[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.