Ejemplo n.º 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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)