From a41a6c333955a30682573be315561be0030abcaf Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 2 Apr 2014 11:45:28 +0200 Subject: [PATCH] restart vsys before we actually trash the vsys handle in sliver --- plugins/vsys.py | 8 ++++---- sliver_lxc.py | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/vsys.py b/plugins/vsys.py index bac56a9..96582a7 100644 --- a/plugins/vsys.py +++ b/plugins/vsys.py @@ -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)) diff --git a/sliver_lxc.py b/sliver_lxc.py index 5121645..7db1a78 100644 --- a/sliver_lxc.py +++ b/sliver_lxc.py @@ -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 -- 2.43.0