def _stream_disk(dev, image_type, virtual_size, image_file):
    offset = 0
    if image_type == ImageType.DISK:
        offset = MBR_SIZE_BYTES
        _write_partition(virtual_size, dev)

    utils.execute('chown', os.getuid(), '/dev/%s' % dev, run_as_root=True)

    with open(dev % '/dev/%s', 'wb') as f:
        f.seek(offset)
        for chunk in image_file:
            f.write(chunk)
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/virt/xenapi/vm_utils.py/_stream_disk/swapped operands of `%`