def save_stats(instance, migration, info, remaining):
 migration.memory_total = info.memory_total
 migration.memory_processed = info.memory_processed
 migration.memory_remaining = info.memory_remaining
 migration.disk_total = info.disk_total
 migration.disk_processed = info.disk_processed
 migration.disk_remaining = info.disk_remaining
 migration.save()
 instance.progress = (100 - remaining)
 instance.save()

def save_stats ( instance , migration , info , remaining ) : migration . memory_total = info . memory_total migration . memory_processed = info . memory_processed migration . memory_remaining = info . memory_remaining migration . disk_total = info . disk_total migration . disk_processed = info . disk_processed migration . disk_remaining = info . disk_remaining migration . save ( ) instance . progress = ( 100 - remaining ) instance . save ( )
save migration stats to the database .