Refactor the unmount part of the initrd context shutdown

This commit is contained in:
Carl D. Roth
2016-11-30 18:23:34 -08:00
parent 15cbc92208
commit 8bee5e7796

View File

@@ -834,7 +834,7 @@ class InitrdContext(SubprocessMixin):
return self
def shutdown(self):
def unmount(self):
p = ProcMountsParser()
if self.dir is not None:
@@ -852,6 +852,10 @@ class InitrdContext(SubprocessMixin):
cmd = ('umount', p,)
self.check_call(cmd, vmode=self.V1)
def shutdown(self):
self.unmount()
if self.initrd and self.dir:
self.log.debug("cleaning up chroot in %s", self.dir)
self.rmtree(self.dir)