restart vsys before we actually trash the vsys handle in sliver
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 2 Apr 2014 09:45:28 +0000 (11:45 +0200)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Wed, 2 Apr 2014 09:45:28 +0000 (11:45 +0200)
plugins/vsys.py
sliver_lxc.py

index bac56a9..96582a7 100644 (file)
@@ -163,16 +163,16 @@ def removeSliverFromVsys (sliver):
     current_slivers=parseConf()
     new_slivers= [ s for s in current_slivers if s != sliver ]
     if writeConf (current_slivers, new_slivers):
-        trashSliverVsys (sliver)
         restartService()
+        trashVsysHandleInSliver (sliver)
     else:
         logger.log("vsys.removeSliverFromConf: no need to remove %s"%sliver)
 
 
-def trashSliverVsys (sliver):
+def trashVsysHandleInSliver (sliver):
     slice_vsys_area = "/vservers/%s/vsys"%sliver
     if not os.path.exists(slice_vsys_area):
-        logger.log("vsys.trashSliverVsys: no action needed, %s not found"%slice_vsys_area)
+        logger.log("vsys.trashVsysHandleInSliver: no action needed, %s not found"%slice_vsys_area)
         return
     ret=subprocess.call([ 'rm', '-rf' , slice_vsys_area])
-    logger.log ("vsys.trashSliverVsys: Removed %s (retcod=%s)"%(slice_vsys_area,retcod))
+    logger.log ("vsys.trashVsysHandleInSliver: Removed %s (retcod=%s)"%(slice_vsys_area,retcod))
index 5121645..7db1a78 100644 (file)
@@ -9,6 +9,12 @@ import os, os.path
 import grp
 from pwd import getpwnam
 from string import Template
+
+# vsys probably should not be a plugin
+# the thing is, the right way to handle stuff would be that
+# if slivers get created by doing a,b,c
+# then they sohuld be delted by doing c,b,a
+# the current ordering model for vsys plugins completely fails to capture that
 from plugins.vsys import removeSliverFromVsys
 
 import libvirt