mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
makebuildserver more robust codepath for vagrant destroy
This commit is contained in:
parent
7e8f7c65bc
commit
3c4b1dec84
1 changed files with 8 additions and 9 deletions
|
@ -324,16 +324,15 @@ def destroy_current_image(v, serverdir):
|
||||||
|
|
||||||
logger.info('destroying buildserver vm, removing images and vagrant-configs...')
|
logger.info('destroying buildserver vm, removing images and vagrant-configs...')
|
||||||
|
|
||||||
# cannot run vagrant without the config in the YAML file
|
|
||||||
if os.path.exists(os.path.join(serverdir, 'Vagrantfile.yaml')):
|
|
||||||
try:
|
try:
|
||||||
v.destroy()
|
v.destroy()
|
||||||
logger.debug('vagrant destroy completed')
|
logger.debug('vagrant destroy completed')
|
||||||
except subprocess.CalledProcessError as e:
|
except subprocess.CalledProcessError as e:
|
||||||
logger.debug('vagrant destroy failed: %s', e)
|
logger.debug('vagrant destroy failed: %s', e)
|
||||||
if logger.level <= logging.DEBUG:
|
try:
|
||||||
logger.debug('Cannot run destroy vagrant setup since Vagrantfile.yaml is not setup!')
|
|
||||||
subprocess.check_call(['vagrant', 'global-status', '--prune'])
|
subprocess.check_call(['vagrant', 'global-status', '--prune'])
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
logger.debug('pruning global vagrant status failed: %s', e)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.rmtree(os.path.join(serverdir, '.vagrant'))
|
shutil.rmtree(os.path.join(serverdir, '.vagrant'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue