mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 07:20:29 +03:00
Merge branch 'fix-post-kvm' into 'master'
Fix post KVM A couple of fixes to the KVM support that was just merged, as reported by @CiaranG See merge request !171
This commit is contained in:
commit
7cbdaedf2e
1 changed files with 13 additions and 9 deletions
|
|
@ -72,7 +72,7 @@ if os.path.isfile('/usr/bin/systemd-detect-virt'):
|
||||||
virt = subprocess.check_output('/usr/bin/systemd-detect-virt').strip().decode('utf-8')
|
virt = subprocess.check_output('/usr/bin/systemd-detect-virt').strip().decode('utf-8')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
virt = 'none'
|
virt = 'none'
|
||||||
if virt == 'qemu' or virt == 'kvm':
|
if virt == 'qemu' or virt == 'kvm' or virt == 'bochs':
|
||||||
print('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
|
print('Running in a VM guest, defaulting to QEMU/KVM via libvirt')
|
||||||
config['vm_provider'] = 'libvirt'
|
config['vm_provider'] = 'libvirt'
|
||||||
elif virt != 'none':
|
elif virt != 'none':
|
||||||
|
|
@ -96,12 +96,16 @@ if os.path.exists(boxfile):
|
||||||
|
|
||||||
if options.clean:
|
if options.clean:
|
||||||
vagrant(['destroy', '-f'], cwd=serverdir, printout=options.verbose)
|
vagrant(['destroy', '-f'], cwd=serverdir, printout=options.verbose)
|
||||||
|
if config['vm_provider'] == 'libvirt':
|
||||||
|
subprocess.call(['virsh', 'undefine', 'buildserver_default'])
|
||||||
|
subprocess.call(['virsh', 'vol-delete', '/var/lib/libvirt/images/buildserver_default.img'])
|
||||||
|
|
||||||
# Update cached files.
|
# Update cached files.
|
||||||
cachedir = config['cachedir']
|
cachedir = config['cachedir']
|
||||||
if not os.path.exists(cachedir):
|
if not os.path.exists(cachedir):
|
||||||
os.makedirs(cachedir, 0o755)
|
os.makedirs(cachedir, 0o755)
|
||||||
|
|
||||||
|
if config['vm_provider'] == 'libvirt':
|
||||||
tmp = cachedir
|
tmp = cachedir
|
||||||
while tmp != '/':
|
while tmp != '/':
|
||||||
mode = os.stat(tmp).st_mode
|
mode = os.stat(tmp).st_mode
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue