Commit 14b3f969 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix broken commit 9e302a8c

Commit 9e302a8c

 split the StopInstance function in two without properly
duplicating the local variables.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 2892a4c9
......@@ -216,6 +216,11 @@ class ChrootManager(hv_base.BaseHypervisor):
"""Cleanup after a stopped instance
"""
root_dir = self._InstanceDir(instance_name)
if not os.path.exists(root_dir):
return
if self._IsDirLive(root_dir):
raise HypervisorError("Processes are still using the chroot")
......@@ -223,7 +228,7 @@ class ChrootManager(hv_base.BaseHypervisor):
utils.RunCmd(["umount", mpath])
result = utils.RunCmd(["umount", root_dir])
if result.failed and force:
if result.failed:
msg = ("Processes still alive in the chroot: %s" %
utils.RunCmd("fuser -vm %s" % root_dir).output)
logging.error(msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment