from oslo.config import cfg from canary.openstack.common import log from canary.transport.wsgi.driver import Driver app_container = Driver() conf = cfg.CONF conf(project='canary', prog='canary', args=[]) log.setup('canary') LOG = log.getLogger(__name__) def _fail(returncode, ex): """Handles terminal errors. :param returncode: process return code to pass to sys.exit :param ex: the error that occurred """ LOG.exception(ex) sys.exit(returncode) def runnable(func): """Entry point wrapper.
from oslo.config import cfg from canary.common import cli from canary.openstack.common import log as logging from canary.transport.wsgi.driver import Driver conf = cfg.CONF conf(project='canary', prog='canary', args=[]) logging.setup('canary') LOG = logging.getLogger(__name__) @cli.runnable def run(): app_container = Driver() app_container.listen()