コード例 #1
0
def launch(bii):
    disk = bii.hive_disk_image
    migration_store = MigrationStore(disk.hivedb)
    manager = MigrationManager(migration_store, get_client_migrations(), bii.user_io.out)

    # Pass in kwargs all variables migrations can need
    manager.migrate(bii)
コード例 #2
0
ファイル: migration_launcher.py プロジェクト: toeb/client
def launch(bii):
    disk = bii.hive_disk_image
    migration_store = MigrationStore(disk.hivedb)
    manager = MigrationManager(migration_store, get_client_migrations(),
                               bii.user_io.out)

    # Pass in kwargs all variables migrations can need
    manager.migrate(bii)
コード例 #3
0
ファイル: hivedb.py プロジェクト: toeb/client
def factory(dbpath):
    try:
        if not os.path.exists(dbpath):
            folder = os.path.dirname(dbpath)
            if not os.path.exists(folder):
                os.makedirs(folder)
            db = HiveDB(dbpath)
            db.connect()
            # Init database with last migration, we are creating it with last version
            db.init(get_client_migrations().pop())
        else:
            db = HiveDB(dbpath)
            db.connect()
        return db
    except Exception as e:
        logger.error(e)
        raise ClientException("Could not initialize local cache", e)
コード例 #4
0
ファイル: hivedb.py プロジェクト: biicode/client
def factory(dbpath):
    try:
        if not os.path.exists(dbpath):
            folder = os.path.dirname(dbpath)
            if not os.path.exists(folder):
                os.makedirs(folder)
            db = HiveDB(dbpath)
            db.connect()
            # Init database with last migration, we are creating it with last version
            db.init(get_client_migrations().pop())
        else:
            db = HiveDB(dbpath)
            db.connect()
        return db
    except Exception as e:
        logger.error(e)
        raise ClientException("Could not initialize local cache", e)