
Adds basic functionality for oslo_config and oslo_log to Ranger uuidgen Change-Id: I041e4e2013fec83d3ff0b5befc581a455cb04ffe
27 lines
628 B
Python
Executable File
27 lines
628 B
Python
Executable File
import os
|
|
|
|
from oslo_log import log as logging
|
|
|
|
from pecan.commands import CommandRunner
|
|
from pecan import make_app
|
|
|
|
LOG = logging.getLogger(__name__)
|
|
|
|
|
|
def setup_app(config):
|
|
app_conf = dict(config.app)
|
|
app = make_app(app_conf.pop('root'),
|
|
logging=getattr(config, 'logging', {}),
|
|
**app_conf)
|
|
LOG.info('Starting uuidgen...')
|
|
|
|
return app
|
|
|
|
|
|
def main():
|
|
dir_name = os.path.dirname(__file__)
|
|
drive, path_and_file = os.path.splitdrive(dir_name)
|
|
path, filename = os.path.split(path_and_file)
|
|
runner = CommandRunner()
|
|
runner.run(['serve', path + '/config.py'])
|