chiark / gitweb /
makebuildserver prune gloabal vagrant status when purging broken VMs
authorMichael Pöhn <michael.poehn@fsfe.org>
Fri, 24 Mar 2017 03:16:30 +0000 (04:16 +0100)
committerHans-Christoph Steiner <hans@eds.org>
Tue, 23 May 2017 18:04:08 +0000 (20:04 +0200)
makebuildserver

index c4e5e02e0b5d0725f7ae35c2b4e46346b8a53756..de0f3b4750587e9ee8120700cb96a123d2ef0331 100755 (executable)
@@ -304,6 +304,7 @@ def destroy_current_image(v, serverdir):
         v.destroy()
     elif options.verbose:
         print('Cannot run destroy vagrant setup since Vagrantfile.yaml is not setup!')
+        subprocess.check_call(['vagrant', 'global-status', '--prune'])
 
     try:
         shutil.rmtree(os.path.join(serverdir, '.vagrant'))
@@ -346,7 +347,7 @@ def kvm_package(boxfile):
         img_info = json.loads(img_info_raw.decode('utf-8'))
         metadata = {"provider": "libvirt",
                     "format": img_info['format'],
-                    "virtual_size": math.ceil(img_info['virtual-size'] / 1024.**3),
+                    "virtual_size": math.ceil(img_info['virtual-size'] / 1024. ** 3),
                     }
 
         vagrantfile = """Vagrant.configure("2") do |config|