openstack-ansible-os_gnocchi/templates/gnocchi-wsgi.py.j2

32 lines
1.1 KiB
Django/Jinja

# Copyright 2013 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import os
{% if gnocchi_venv_enabled | bool %}
activate_this = os.path.expanduser("{{ gnocchi_venv_bin }}/activate_this.py")
execfile(activate_this, dict(__file__=activate_this))
{% endif %}
from oslo_config import cfg
from gnocchi import service
from gnocchi.rest import app
# Initialize the oslo configuration library and logging
conf = service.prepare_service()
# The pecan debugger cannot be used in wsgi mode
conf.set_default('pecan_debug', False, group='api')
application = app.load_app(conf)