diff --git a/magnum/api/app.py b/magnum/api/app.py index cae197aa63..1d7e8e2fd2 100755 --- a/magnum/api/app.py +++ b/magnum/api/app.py @@ -10,6 +10,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +import sys from oslo_config import cfg from oslo_log import log @@ -19,6 +20,7 @@ import pecan from magnum.api import config as api_config from magnum.api import middleware from magnum.common import config as common_config +from magnum.common import service import magnum.conf CONF = magnum.conf.CONF @@ -65,3 +67,8 @@ def load_app(): def app_factory(global_config, **local_conf): return setup_app() + + +def build_wsgi_app(argv=None): + service.prepare_service(sys.argv) + return load_app() diff --git a/setup.cfg b/setup.cfg index f0e8860e6e..062a843428 100644 --- a/setup.cfg +++ b/setup.cfg @@ -47,6 +47,9 @@ console_scripts = magnum-driver-manage = magnum.cmd.driver_manage:main magnum-status = magnum.cmd.status:main +wsgi_scripts = + magnum-api-wsgi = magnum.api.app:build_wsgi_app + oslo.config.opts = magnum = magnum.opts:list_opts magnum.conf = magnum.conf.opts:list_opts