non-interactive instance removal fails to actually remove the instance

Bug #1218111 reported by Kim Phillips
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LAVA Deployment Tool
Fix Released
Medium
Antonio Terceiro

Bug Description

Note: This is on Ubuntu 13.04.

[kim@ntel lava-deployment-tool]$ ./lava-deployment-tool list
====================
LAVA Deployment Tool
====================

================================
INSTANCE_NAME VHOST/LOCATION
================================
testinstance vhost
testinstance-dev vhost
================================
[kim@ntel lava-deployment-tool]$ ./lava-deployment-tool remove --non-interactive testinstance
====================
LAVA Deployment Tool
====================

*** WARNING ***
You are about to IRREVERSIBLY DESTROY the instance testinstance
There is no automatic backup, there is no way to undo this step
*** WARNING ***
We will remove system user lava-testinstance
We will remove PostgreSQL database lava-testinstance
We will remove PostgreSQL user: lava-testinstance
We will remove everything in /srv/lava/instances/testinstance
We will remove the apache site testinstance.conf

[kim@ntel lava-deployment-tool]$ ./lava-deployment-tool list
====================
LAVA Deployment Tool
====================

================================
INSTANCE_NAME VHOST/LOCATION
================================
testinstance vhost
testinstance-dev vhost
================================
[kim@ntel lava-deployment-tool]$ ./lava-deployment-tool remove testinstance
====================
LAVA Deployment Tool
====================

*** WARNING ***
You are about to IRREVERSIBLY DESTROY the instance testinstance
There is no automatic backup, there is no way to undo this step
*** WARNING ***
We will remove system user lava-testinstance
We will remove PostgreSQL database lava-testinstance
We will remove PostgreSQL user: lava-testinstance
We will remove everything in /srv/lava/instances/testinstance
We will remove the apache site testinstance.conf

Type DESTROY to continue: DESTROY
+ sudo stop lava-instance LAVA_INSTANCE=testinstance
lava-instance stop/waiting
+ sudo rm -f /etc/apache2/sites-available/testinstance.conf
+ sudo rm -f /etc/apache2/sites-enabled/testinstance.conf
+ sudo rm -f /etc/apache2/conf.d/testinstance.conf
+ '[' 'devmode user fs buildout database web_hosting app config_app' '!=' 'get_master devmode user fs buildout remote_database web_hosting app config_app remote_fs' ']'
+ sudo -u postgres dropdb lava-testinstance
[sudo] password for kim:
+ sudo -u postgres dropuser lava-testinstance
+ '[' yes = yes ']'
+ sudo userdel lava-testinstance
+ sudo rm -rf /srv/lava/instances/testinstance
+ set +x
[kim@ntel lava-deployment-tool]$ ./lava-deployment-tool list
====================
LAVA Deployment Tool
====================

================================
INSTANCE_NAME VHOST/LOCATION
================================
testinstance-dev vhost
================================
[kim@ntel lava-deployment-tool]$

Related branches

Fathi Boudra (fboudra)
affects: lava-server → lava-deployment-tool
Changed in lava-deployment-tool:
importance: Undecided → Medium
assignee: nobody → Antonio Terceiro (terceiro)
status: New → Confirmed
Revision history for this message
Antonio Terceiro (terceiro) wrote :

IMO non-interactive removal is a little too dangerous to be allowed.

I am adding a suitable error message to better guide people through that.

Revision history for this message
Kim Phillips (kim-phillips) wrote :

hmm, I can - and want - to use lava-deployment-tool in batch-mode unattended scripts - something I envision --non-interactive was designed-in for in the first place. Can we add a --force option? It could also apply to the interactive component well, so the user wouldn't have to repeatedly type 'DESTROY' whilst deleting a bunch of old instances.

Revision history for this message
Antonio Terceiro (terceiro) wrote : Re: [Bug 1218111] Re: non-interactive instance removal fails to actually remove the instance

Yes, you are right. I will write the code for that.

Revision history for this message
Antonio Terceiro (terceiro) wrote :

this has been fixed by commit 8985339cf

Changed in lava-deployment-tool:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.