diff --git a/barbican/api/app.py b/barbican/api/app.py index 4a9dfac61..0448c6abe 100644 --- a/barbican/api/app.py +++ b/barbican/api/app.py @@ -18,6 +18,7 @@ API application handler for Barbican """ import os +from paste import deploy import pecan try: @@ -101,3 +102,9 @@ def create_main_app(global_config, **local_conf): def create_version_app(global_config, **local_conf): wsgi_app = pecan.make_app(versions.VersionsController()) return wsgi_app + + +def get_api_wsgi_script(): + conf = '/etc/barbican/barbican-api-paste.ini' + application = deploy.loadapp('config:%s' % conf) + return application diff --git a/barbican/api/app.wsgi b/barbican/api/app.wsgi index 6c506cbc6..362a08687 100644 --- a/barbican/api/app.wsgi +++ b/barbican/api/app.wsgi @@ -16,10 +16,11 @@ """Use this file for deploying the API under mod_wsgi. 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 - -conf = '/etc/barbican/barbican-api-paste.ini' -application = deploy.loadapp('config:%s' % conf) +from barbican.api import app +application = app.get_api_wsgi_script() diff --git a/setup.cfg b/setup.cfg index d0f81c52f..150127a03 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,6 +40,9 @@ console_scripts = pkcs11-key-generation = barbican.cmd.pkcs11_key_generation:main barbican-retry = barbican.cmd.retry_scheduler:main +wsgi_scripts = + barbican-wsgi-api = barbican.api.app:get_api_wsgi_script + barbican.secretstore.plugin = store_crypto = barbican.plugin.store_crypto:StoreCryptoAdapterPlugin dogtag_crypto = barbican.plugin.dogtag:DogtagKRAPlugin