+ if not os.path.exists(containerDir):
+ logger.log('sliver_lxc.destroy: %s cleanly destroyed.'%name)
+ else:
+ # oh no, it's still here...
+ # this is more of a way to try and understand what is going on here
+ # than a real solution to anything
+ pass_no=1
+ max_passes=2
+ while pass_no <= max_passes:
+ command = ['rm', '-rf', containerDir]
+ logger.log("sliver_lxc.destroy: cleanup pass %d - command %s"%(pass_no,command))
+ logger.log_call(command, timeout=5)
+ command = ['btrfs', 'subvolume', 'delete', containerDir]
+ logger.log("sliver_lxc.destroy: cleanup pass %d - command %s"%(pass_no,command))
+ logger.log_call(command, timeout=5)
+ import time
+ time.sleep(1)
+ pass_no += 1
+ if os.path.exists(containerDir):
+ logger.log('sliver_lxc.destroy: could not cleanly destroy %s - giving up'%name)
+
+ if vsys_stopped: vsysStartService()