chiark / gitweb /
delete .vagrant dir when cleaning up buildserver vm
authorMichael Pöhn <michael.poehn@fsfe.org>
Fri, 24 Mar 2017 02:15:35 +0000 (03:15 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 23 May 2017 18:04:08 +0000 (20:04 +0200)
makebuildserver

index 2fc75d8232790038cdf81a0c7d1835bdf182b6a0..c4e5e02e0b5d0725f7ae35c2b4e46346b8a53756 100755 (executable)
@@ -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: