Commit 7be85163 authored by Guido Trotter's avatar Guido Trotter

KVM: don't fail removing non-existing nic path

This shouldn't normally happen, but if it does no need to fail.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 5d9bfd87
......@@ -381,7 +381,11 @@ class KVMHypervisor(hv_base.BaseHypervisor):
utils.RemoveFile(uid_file)
if uid is not None:
uidpool.ReleaseUid(uid)
shutil.rmtree(cls._InstanceNICDir(instance_name))
try:
shutil.rmtree(cls._InstanceNICDir(instance_name))
except OSError, err:
if err.errno != errno.ENOENT:
raise
try:
chroot_dir = cls._InstanceChrootDir(instance_name)
utils.RemoveDir(chroot_dir)
......
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