Merge "Call kpartx remove in umount, not cleanup"

This commit is contained in:
Zuul 2018-07-24 23:05:16 +00:00 committed by Gerrit Code Review
commit 48645abff6
2 changed files with 9 additions and 4 deletions

View File

@ -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()

View File

@ -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