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)
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)