Example #1
0
    def _load_paste_app(self, name, paste_conf, conf):
        conf_file_path = os.path.join(self.test_dir, '%s-paste.ini' % name)
        with open(conf_file_path, 'wb') as conf_file:
            conf_file.write(paste_conf)
            conf_file.flush()

        return os_pastedeploy.paste_deploy_app(conf_file_path,
                                               name,
                                               conf)
Example #2
0
def main():
    try:
        conf = config.get_config_object()
        paste_file = conf.find_file(conf.paste_deploy.config_file)
        wsgi_app = os_pastedeploy.paste_deploy_app(paste_file,
                                                   'staccato-api',
                                                   conf)
        server = os_wsgi.Service(wsgi_app, conf.bind_port)
        server.start()
        server.wait()
    except RuntimeError as e:
        fail(1, e)
Example #3
0
def main():
    try:
        conf = config.get_config_object()

        paste_file = conf.find_file(conf.paste_deploy.config_file)
        if conf.paste_deploy.flavor is None:
            flavor = 'staccato-api'
        else:
            flavor = 'staccato-api-' + conf.paste_deploy.flavor

        log.setup('staccato')
        wsgi_app = os_pastedeploy.paste_deploy_app(paste_file,
                                                   flavor,
                                                   conf)
        server = os_wsgi.Service(wsgi_app, conf.bind_port)
        server.start()
        server.wait()
    except RuntimeError as e:
        fail(1, e)