From 8cfd3ca770bfa086782a575837b506fcb13d7ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20P=C3=B6hn?= Date: Fri, 24 Mar 2017 03:15:35 +0100 Subject: [PATCH] delete .vagrant dir when cleaning up buildserver vm --- makebuildserver | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/makebuildserver b/makebuildserver index 2fc75d82..c4e5e02e 100755 --- a/makebuildserver +++ b/makebuildserver @@ -304,6 +304,12 @@ def destroy_current_image(v, serverdir): v.destroy() elif options.verbose: print('Cannot run destroy vagrant setup since Vagrantfile.yaml is not setup!') + + try: + shutil.rmtree(os.path.join(serverdir, '.vagrant')) + except Exception as e: + print("could not delete vagrant dir: %s, %s" % (os.path.join(serverdir, '.vagrant'), e)) + if config['vm_provider'] == 'libvirt': import libvirt try: