Enable nova-placement-api config and logging

nova-placement-api is a bit tricky. The wsgi application doesn't accept
CLI arguments, so we can't pass --config-file, --config-dir, or
--log-file via uwsgi's pyargv. Additionally, nova-placement-api doesn't
pass the [keystone_authtoken] from the config file found in
OS_PLACEMENT_CONFIG_DIR to keystonemiddleware.

We continue to use the OS_PLACEMENT_CONFIG_DIR environment variable to
point at the default nova.conf in $SNAP/etc/nova.conf. This default
nova.conf includes logdir=$SNAP_COMMON/log/, enabling nova-placement-api.log
to be written to the correct directory.

Passing [keystone_authtoken] to keystonemiddleware is fixed in oslo.config.
The prior commit titled "Patch (_COMMON) dirs into oslo.config defaults"
includes a patch for this. keystonemiddleware gets the [keystone_authtoken]
config via oslo.config's find_config_files() and find_config_dirs(), which
are patched to include the $SNAP and $SNAP_COMMON config directories.

Change-Id: I02e2a5d9df91eb8cbf36beb474809bc1e80fe80b
Closes-Bug: 1696830
This commit is contained in:
Corey Bryant 2017-06-13 13:14:00 +00:00
parent 4d3bfe28b4
commit f011198f5b
3 changed files with 5 additions and 2 deletions

View File

@ -1,4 +1,7 @@
# Snap distribution defaults - do not change, override in $SNAP_COMMON/etc/nova.conf.d
[DEFAULT]
logdir=/var/snap/nova/common/log/
[wsgi]
secure_proxy_ssl_header = HTTP_X_FORWARDED_PROTO

View File

@ -8,4 +8,3 @@ processes = 4
thunder-lock = true
lazy-apps = true
home = {{ snap }}/usr
pyargv = {{ pyargv }}

View File

@ -26,9 +26,10 @@ apps:
uwsgi:
command: >
env PYTHONPATH=$PYTHONPATH:$SNAP/lib/python2.7/site-packages
OS_PLACEMENT_CONFIG_DIR=$SNAP_COMMON/etc/nova
$SNAP/usr/bin/python2 $SNAP/bin/snap-openstack nova-uwsgi
daemon: simple
environment:
OS_PLACEMENT_CONFIG_DIR: $SNAP/etc/nova/
nginx:
command: >
env PYTHONPATH=$PYTHONPATH:$SNAP/lib/python2.7/site-packages