mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 15:02:51 +03:00
vmtools: in KVM mode, only call sudo hack when file is not readable
This commit is contained in:
parent
b1bab81739
commit
27d332c8ae
1 changed files with 5 additions and 1 deletions
|
@ -29,6 +29,8 @@ import textwrap
|
|||
from .common import FDroidException
|
||||
from logging import getLogger
|
||||
|
||||
from fdroidserver import _
|
||||
|
||||
logger = getLogger('fdroidserver-vmtools')
|
||||
|
||||
|
||||
|
@ -383,6 +385,8 @@ class LibvirtBuildVm(FDroidBuildVm):
|
|||
vol = storagePool.storageVolLookupByName(self.srvname + '.img')
|
||||
imagepath = vol.path()
|
||||
# TODO use a libvirt storage pool to ensure the img file is readable
|
||||
if not os.access(imagepath, os.R_OK):
|
||||
logger.warning(_('Cannot read "{path}"!').format(path=imagepath))
|
||||
_check_call(['sudo', '/bin/chmod', '-R', 'a+rX', '/var/lib/libvirt/images'])
|
||||
shutil.copy2(imagepath, 'box.img')
|
||||
_check_call(['qemu-img', 'rebase', '-p', '-b', '', 'box.img'])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue