def nebula_mission_config(): from oslo.config import cfg from nebula.core import config CONF = cfg.CONF CONF.import_group('missions', 'nebula.mission_control.options') config.set_defaults(args=[], prog='nebula-missions') config.setup_logging() return CONF
# -*- coding: utf-8 -*- def systeminfo(key, default="default"): return default if __name__ == '__main__': from nebula.core import config config.set_defaults(args=[], prog='blah') print(systeminfo("system_copyright")) print(systeminfo("system_cht"))
def get_session(): from nebula.core import config config.set_defaults(args=[], prog='blah') engine = create_engine(cfg.CONF.database.connection) session_maker = sessionmaker(bind=engine) return session_maker()
# -*- coding: utf-8 -*- from invoke import Collection from nebula.core import config from . import db from . import data from . import test from . import doc from . import server from . import i18n config.set_defaults(args=[]) config.setup_logging() ns = Collection() ns.add_collection(Collection.from_module(server)) ns.add_collection(Collection.from_module(data)) ns.add_collection(Collection.from_module(db))
def _setup_opts(): # Setup configuration config.set_defaults(prog='nebula-portal') config.setup_logging() CONF.portal.using_scope = True