mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-03 17:50:11 +02:00
vmtools: use standard imports: os.remove()
The rest of the code uses os.remove()
This commit is contained in:
parent
4463bf238d
commit
f24cf7f71b
@ -16,7 +16,6 @@
|
|||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from os import remove as rmfile
|
|
||||||
from os.path import isdir, isfile, basename, abspath, expanduser
|
from os.path import isdir, isfile, basename, abspath, expanduser
|
||||||
import os
|
import os
|
||||||
import math
|
import math
|
||||||
@ -376,11 +375,11 @@ class LibvirtBuildVm(FDroidBuildVm):
|
|||||||
if storagePool:
|
if storagePool:
|
||||||
|
|
||||||
if isfile('metadata.json'):
|
if isfile('metadata.json'):
|
||||||
rmfile('metadata.json')
|
os.remove('metadata.json')
|
||||||
if isfile('Vagrantfile'):
|
if isfile('Vagrantfile'):
|
||||||
rmfile('Vagrantfile')
|
os.remove('Vagrantfile')
|
||||||
if isfile('box.img'):
|
if isfile('box.img'):
|
||||||
rmfile('box.img')
|
os.remove('box.img')
|
||||||
|
|
||||||
logger.debug('preparing box.img for box %s', output)
|
logger.debug('preparing box.img for box %s', output)
|
||||||
vol = storagePool.storageVolLookupByName(self.srvname + '.img')
|
vol = storagePool.storageVolLookupByName(self.srvname + '.img')
|
||||||
@ -430,9 +429,9 @@ class LibvirtBuildVm(FDroidBuildVm):
|
|||||||
|
|
||||||
if not keep_box_file:
|
if not keep_box_file:
|
||||||
logger.debug('box packaging complete, removing temporary files.')
|
logger.debug('box packaging complete, removing temporary files.')
|
||||||
rmfile('metadata.json')
|
os.remove('metadata.json')
|
||||||
rmfile('Vagrantfile')
|
os.remove('Vagrantfile')
|
||||||
rmfile('box.img')
|
os.remove('box.img')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logger.warn('could not connect to storage-pool \'default\',' +
|
logger.warn('could not connect to storage-pool \'default\',' +
|
||||||
|
Loading…
Reference in New Issue
Block a user