コード例 #1
0
ファイル: db_manage.py プロジェクト: alex/solum
def get_manager():
    # Our CONF object is not the same as the db one so make sure the
    # database.connection is made know to the oslo DB layer.
    session.set_defaults(sql_connection=CONF.database.connection, sqlite_db='')
    alembic_path = os.path.join(os.path.dirname(__file__),
                                '..', 'objects', 'sqlalchemy',
                                'migration', 'alembic.ini')
    migrate_path = os.path.join(os.path.dirname(__file__),
                                '..', 'objects', 'sqlalchemy',
                                'migration', 'alembic_migrations')
    migration_config = {'alembic_ini_path': alembic_path,
                        'migration_repo_path': migrate_path,
                        'alembic_repo_path': migrate_path}
    return migration_manager.MigrationManager(migration_config)
コード例 #2
0
ファイル: db_manage.py プロジェクト: alex/solum
def get_manager():
    # Our CONF object is not the same as the db one so make sure the
    # database.connection is made know to the oslo DB layer.
    session.set_defaults(sql_connection=CONF.database.connection, sqlite_db='')
    alembic_path = os.path.join(os.path.dirname(__file__), '..', 'objects',
                                'sqlalchemy', 'migration', 'alembic.ini')
    migrate_path = os.path.join(os.path.dirname(__file__), '..', 'objects',
                                'sqlalchemy', 'migration',
                                'alembic_migrations')
    migration_config = {
        'alembic_ini_path': alembic_path,
        'migration_repo_path': migrate_path,
        'alembic_repo_path': migrate_path
    }
    return migration_manager.MigrationManager(migration_config)
コード例 #3
0
ファイル: db_manage.py プロジェクト: jamesyli/solum
def get_manager():
    CONF.import_opt('connection',
                    'solum.openstack.common.db.sqlalchemy.session',
                    group='database')
    session.set_defaults(sql_connection=CONF.database.connection,
                         sqlite_db='')
    session.get_session(mysql_traditional_mode=True)
    alembic_path = os.path.join(os.path.dirname(__file__),
                                '..', 'objects', 'sqlalchemy',
                                'migration', 'alembic.ini')
    migrate_path = os.path.join(os.path.dirname(__file__),
                                '..', 'objects', 'sqlalchemy',
                                'migration', 'alembic_migrations')
    migration_config = {'alembic_ini_path': alembic_path,
                        'migration_repo_path': migrate_path,
                        'alembic_repo_path': migrate_path}
    return migration_manager.MigrationManager(migration_config)
コード例 #4
0
def get_manager():
    CONF.import_opt('connection',
                    'solum.openstack.common.db.sqlalchemy.session',
                    group='database')
    session.set_defaults(sql_connection=CONF.database.connection, sqlite_db='')
    session.get_session(mysql_traditional_mode=True)
    alembic_path = os.path.join(os.path.dirname(__file__), '..', 'objects',
                                'sqlalchemy', 'migration', 'alembic.ini')
    migrate_path = os.path.join(os.path.dirname(__file__), '..', 'objects',
                                'sqlalchemy', 'migration',
                                'alembic_migrations')
    migration_config = {
        'alembic_ini_path': alembic_path,
        'migration_repo_path': migrate_path,
        'alembic_repo_path': migrate_path
    }
    return manager.MigrationManager(migration_config)
コード例 #5
0
ファイル: utils.py プロジェクト: jamesyli/solum
 def configure(self):
     session.set_defaults(sql_connection="sqlite:///%s" % self.db_file,
                          sqlite_db=self.db_file)
     cfg.CONF.set_default('sqlite_synchronous', False)
コード例 #6
0
 def configure(self):
     session.set_defaults(sql_connection="sqlite:///%s" % self.db_file,
                          sqlite_db=self.db_file)
     cfg.CONF.set_default('sqlite_synchronous', False)