File: virtualdiskimage.py

package info (click to toggle)
bootstrap-vz 0.9.11%2B20180121git-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,244 kB
  • sloc: python: 8,800; sh: 813; makefile: 16
file content (15 lines) | stat: -rw-r--r-- 423 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from qemuvolume import QEMUVolume


class VirtualDiskImage(QEMUVolume):

    extension = 'vdi'
    qemu_format = 'vdi'
    # VDI format does not have an URI (check here: https://forums.virtualbox.org/viewtopic.php?p=275185#p275185)
    ovf_uri = None

    def get_uuid(self):
        import uuid
        with open(self.image_path) as image:
            image.seek(392)
            return uuid.UUID(bytes_le=image.read(16))