diff --git a/diskimage_builder/block_device/level1/partition.py b/diskimage_builder/block_device/level1/partition.py index 54c769267..c79a688cf 100644 --- a/diskimage_builder/block_device/level1/partition.py +++ b/diskimage_builder/block_device/level1/partition.py @@ -84,5 +84,8 @@ class PartitionNode(NodeBase): def create(self): self.partitioning.create() + def umount(self): + self.partitioning.umount() + def cleanup(self): self.partitioning.cleanup() diff --git a/diskimage_builder/block_device/level1/partitioning.py b/diskimage_builder/block_device/level1/partitioning.py index bc2a728ef..86924647b 100644 --- a/diskimage_builder/block_device/level1/partitioning.py +++ b/diskimage_builder/block_device/level1/partitioning.py @@ -215,13 +215,15 @@ class Partitioning(PluginBase): return - def cleanup(self): + def umount(self): # remove the partition mappings made for the parent # block-device by create() above. this is called from the - # child PartitionNode umount/delete/cleanup. Thus every - # partition calls it, but we only want to do it once and our - # gate. + # child PartitionNode umount. Thus every partition calls it, + # but we only want to do it once and our gate. if not self.already_cleaned: self.already_cleaned = True exec_sudo(["kpartx", "-d", self.state['blockdev'][self.base]['device']]) + + def cleanup(self): + pass