def _make_app(self, enable_acl=False): # Determine where we are so we can set up paths in the config root_dir = self.get_path() self.config = { 'app': { 'root': 'watcher.api.controllers.root.RootController', 'modules': ['watcher.api'], 'hooks': [hooks.ContextHook(), hooks.NoExceptionTracebackHook()], 'template_path': '%s/api/templates' % root_dir, 'enable_acl': enable_acl, 'acl_public_routes': ['/', '/v1'], }, } return pecan.testing.load_test_app(self.config)
from oslo_config import cfg from watcher.api import hooks # Server Specific Configurations # See https://pecan.readthedocs.org/en/latest/configuration.html#server-configuration # noqa server = {'port': '9322', 'host': '0.0.0.0'} # Pecan Application Configurations # See https://pecan.readthedocs.org/en/latest/configuration.html#application-configuration # noqa app = { 'root': 'watcher.api.controllers.root.RootController', 'modules': ['watcher.api'], 'hooks': [ hooks.ContextHook(), hooks.NoExceptionTracebackHook(), ], 'static_root': '%(confdir)s/public', 'enable_acl': True, 'acl_public_routes': [ '/', ], } # WSME Configurations # See https://wsme.readthedocs.org/en/latest/integrate.html#configuration wsme = { 'debug': cfg.CONF.get("debug") if "debug" in cfg.CONF else False, } PECAN_CONFIG = {