Add PBR wsgi_scripts entrypoint for barbican api

This commit makes the barbican wsgi script consistent with other
services by leveraging the pbr wsgi_scripts entrypoint to expose it.
While you could still leverage the bundled app.wsgi the entrypoint
barbican's behavior the same as other services. As part of this the
app.wsgi script is deprecated and will be removed in the future.

Change-Id: Id42f76dbfd59209232b37096a708ee18cbf96431
This commit is contained in:
Matthew Treinish 2017-06-23 14:04:05 -04:00
parent 75e865e956
commit 69561af93f
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
3 changed files with 15 additions and 4 deletions

View File

@ -18,6 +18,7 @@ API application handler for Barbican
""" """
import os import os
from paste import deploy
import pecan import pecan
try: try:
@ -101,3 +102,9 @@ def create_main_app(global_config, **local_conf):
def create_version_app(global_config, **local_conf): def create_version_app(global_config, **local_conf):
wsgi_app = pecan.make_app(versions.VersionsController()) wsgi_app = pecan.make_app(versions.VersionsController())
return wsgi_app return wsgi_app
def get_api_wsgi_script():
conf = '/etc/barbican/barbican-api-paste.ini'
application = deploy.loadapp('config:%s' % conf)
return application

View File

@ -16,10 +16,11 @@
"""Use this file for deploying the API under mod_wsgi. """Use this file for deploying the API under mod_wsgi.
See http://pecan.readthedocs.org/en/latest/deployment.html for details. See http://pecan.readthedocs.org/en/latest/deployment.html for details.
NOTE(mtreinish): This wsgi script is deprecated since the wsgi app is now
exposed as an entrypoint via barbican-wsgi-api
""" """
from paste import deploy from barbican.api import app
conf = '/etc/barbican/barbican-api-paste.ini'
application = deploy.loadapp('config:%s' % conf)
application = app.get_api_wsgi_script()

View File

@ -40,6 +40,9 @@ console_scripts =
pkcs11-key-generation = barbican.cmd.pkcs11_key_generation:main pkcs11-key-generation = barbican.cmd.pkcs11_key_generation:main
barbican-retry = barbican.cmd.retry_scheduler:main barbican-retry = barbican.cmd.retry_scheduler:main
wsgi_scripts =
barbican-wsgi-api = barbican.api.app:get_api_wsgi_script
barbican.secretstore.plugin = barbican.secretstore.plugin =
store_crypto = barbican.plugin.store_crypto:StoreCryptoAdapterPlugin store_crypto = barbican.plugin.store_crypto:StoreCryptoAdapterPlugin
dogtag_crypto = barbican.plugin.dogtag:DogtagKRAPlugin dogtag_crypto = barbican.plugin.dogtag:DogtagKRAPlugin