hv_chroot: move unmount to CleanupInstance()
[ganeti-local] / lib / hypervisor / hv_chroot.py
index 36b37a8..c495c9e 100644 (file)
@@ -212,6 +212,13 @@ class ChrootManager(hv_base.BaseHypervisor):
         raise HypervisorError("Can't stop the processes using the chroot")
       return
 
+  def CleanupInstance(self, instance_name):
+    """Cleanup after a stopped instance
+
+    """
+    if self._IsDirLive(root_dir):
+      raise HypervisorError("Processes are still using the chroot")
+
     for mpath in self._GetMountSubdirs(root_dir):
       utils.RunCmd(["umount", mpath])