Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -216,6 +216,11 @@ class ChrootManager(hv_base.BaseHypervisor): ...@@ -216,6 +216,11 @@ class ChrootManager(hv_base.BaseHypervisor):
"""Cleanup after a stopped instance """Cleanup after a stopped instance
""" """
root_dir = self._InstanceDir(instance_name)
if not os.path.exists(root_dir):
return
if self._IsDirLive(root_dir): if self._IsDirLive(root_dir):
raise HypervisorError("Processes are still using the chroot") raise HypervisorError("Processes are still using the chroot")
...@@ -223,7 +228,7 @@ class ChrootManager(hv_base.BaseHypervisor): ...@@ -223,7 +228,7 @@ class ChrootManager(hv_base.BaseHypervisor):
utils.RunCmd(["umount", mpath]) utils.RunCmd(["umount", mpath])
result = utils.RunCmd(["umount", root_dir]) result = utils.RunCmd(["umount", root_dir])
if result.failed and force: if result.failed:
msg = ("Processes still alive in the chroot: %s" % msg = ("Processes still alive in the chroot: %s" %
utils.RunCmd("fuser -vm %s" % root_dir).output) utils.RunCmd("fuser -vm %s" % root_dir).output)
logging.error(msg) logging.error(msg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment