Skip to content

Instantly share code, notes, and snippets.

@jrziviani
Created October 7, 2014 17:22
Show Gist options
  • Save jrziviani/033c9a96286965b11c9c to your computer and use it in GitHub Desktop.
Save jrziviani/033c9a96286965b11c9c to your computer and use it in GitHub Desktop.
>>> sda = b.devicetree.getDeviceByName("sda")
>>> new_part = b.newPartition(size=Size("10GiB"), parents=[sda])
>>> b.createDevice(new_part)
>>> blivet.partitioning.doPartitioning(b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 889, in doPartitioning
allocatePartitions(storage, disks, partitions, free)
File "/usr/lib/python2.7/site-packages/blivet/partitioning.py", line 1006, in allocatePartitions
disklabel = disklabels[_disk.path]
KeyError: '/dev/sda'
>>> quit()
NOTE:
storage.partitioned in doPartitioning() is an empty list.
>>> b.partitions
[PartitionDevice instance (0x3fffa81bb550) --
name = req0 status = False kids = 0 id = 49
parents = []
uuid = None size = 10 GiB
format = non-existent None
major = 0 minor = 0 exists = False protected = False
sysfs path = partedDevice = None
target size = 10 GiB path = /dev/req0
format args = [] originalFormat = None grow = False max size = 0 B bootable = None
part type = None primary = False start sector = None end sector = None
partedPartition = None
disk = None
]
>>> b.partitioned
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment