add configuration files and options

Implements: blueprint get-topology-api
Change-Id: Id0399997cfe23975774a828cbc6e608484f0b988
This commit is contained in:
Eyal 2015-11-30 11:44:37 +02:00
parent 6d0c510360
commit cb4e3be14e
6 changed files with 45 additions and 1 deletions

1
.gitignore vendored
View File

@ -21,6 +21,7 @@ ChangeLog
.testrepository
.coverage
cover
etc/vitrage/vitrage.conf
#Python
*.pyc

View File

@ -0,0 +1,4 @@
To generate the sample vitrage.conf file, run the following
command from the top-level vitrage directory:
tox -egenconfig

14
etc/vitrage/api-paste.ini Normal file
View File

@ -0,0 +1,14 @@
# Remove keystone_authtoken from the pipeline if you don't want to use keystone authentication
[pipeline:main]
pipeline = keystone_authtoken vitrage
[app:vitrage]
paste.app_factory = vitrage.api.app:app_factory
[filter:keystone_authtoken]
paste.filter_factory = keystonemiddleware.auth_token:filter_factory
oslo_config_project = vitrage
[filter:cors]
paste.filter_factory = oslo_middleware.cors:filter_factory
oslo_config_project = vitrage

View File

@ -0,0 +1,9 @@
[DEFAULT]
output_file = etc/vitrage/vitrage.conf
wrap_width = 79
namespace = vitrage
namespace = oslo.db
namespace = oslo.log
namespace = oslo.middleware
namespace = oslo.policy
namespace = keystonemiddleware.auth_token

View File

@ -9,11 +9,16 @@ install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands =
python setup.py testr --slowest --testr-args='{posargs}'
oslo-config-generator --config-file=etc/vitrage/vitrage-config-generator.conf
[testenv:pep8]
commands = flake8
[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/vitrage/vitrage-config-generator.conf
[testenv:venv]
commands = {posargs}

View File

@ -15,6 +15,17 @@ from oslo_config import cfg
def list_opts():
return [("api", (
cfg.PortOpt('port',
default=8999,
help='The port for the vitrage API server.',
),
cfg.StrOpt('host',
default='0.0.0.0',
help='The listen IP for the vitrage API server.',
),
cfg.StrOpt('paste_config', default="api-paste.ini",
help="Configuration file for WSGI definition of API."),
cfg.IntOpt('workers', default=1,
min=1,
help='Number of workers for vitrage API server.'),