X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_lxc.py;fp=sliver_lxc.py;h=51216458030af0c49b6531726649eaec55e15a2f;hb=4bf2fe496500faab4eacd9e526424559e6901dea;hp=92c6b6c421a4069c4a55547ef40b0c36230ae2bc;hpb=8225262f42fdb717c8e2a5b8bd591d07116c743e;p=nodemanager.git diff --git a/sliver_lxc.py b/sliver_lxc.py index 92c6b6c..5121645 100644 --- a/sliver_lxc.py +++ b/sliver_lxc.py @@ -9,6 +9,7 @@ import os, os.path import grp from pwd import getpwnam from string import Template +from plugins.vsys import removeSliverFromVsys import libvirt @@ -295,13 +296,10 @@ unset pathmunge command = ['/usr/sbin/userdel', '-f', '-r', name] logger.log_call(command, timeout=15*60) - if os.path.exists(os.path.join(containerDir,"vsys")): - # Slivers with vsys running will fail the subvolume delete. - # A more permanent solution may be to ensure that the vsys module - # is called before the sliver is destroyed. - logger.log("destroying vsys directory and restarting vsys") - logger.log_call(["rm", "-fR", os.path.join(containerDir, "vsys")]) - logger.log_call(["/etc/init.d/vsys", "restart", ]) + # Slivers with vsys running will fail the subvolume delete. + # A more permanent solution may be to ensure that the vsys module + # is called before the sliver is destroyed. + removeSliverFromVsys (name) # Remove rootfs of destroyed domain command = ['btrfs', 'subvolume', 'delete', containerDir]