Fail to uninstall plugins because uninstall.sh is executed unconditionnaly

Bug #1574478 reported by Simon Pasquier
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
High
Roman Prykhodchenko
Mitaka
Won't Fix
High
Roman Prykhodchenko

Bug Description

Detailed bug description:

Because the prerun hook doesn't check if the plugin ships with an uninstall.sh script, the removal of plugins can fail.

Steps to reproduce:

1. Build the fuel-plugin-elasticsearch-kibana plugin from the master branch.
2. Install the plugin on the Fuel master node.
3. Remove the plugin from the Fuel master node.

Expected results:

Success.

Actual result:

Running transaction
/var/tmp/rpm-tmp.z5qrwD: line 7: syntax error near unexpected token `fi'
/var/tmp/rpm-tmp.z5qrwD: line 7: `fi'
error: %preun(elasticsearch_kibana-0.9-0.9.0-1.noarch) scriptlet failed, exit status 2
Error in PREUN scriptlet in rpm package elasticsearch_kibana-0.9-0.9.0-1.noarch
  Verifying : elasticsearch_kibana-0.9-0.9.0-1.noarch 1/1
Failed:
  elasticsearch_kibana-0.9.noarch 0:0.9.0-1
Complete!
Shell command executed with "1" exit code: yum -y remove elasticsearch_kibana-0.9

Reproducibility:

Always.

Workaround:

For plugin developers: Add uninstall.sh script in the plugin repository.
For end-users: rpm -e --noscripts <plugin package>

Impact:

The end-user can't uninstall the plugin.

Description of the environment:
 Operation system: Ubuntu
 Versions of components: N/A
 Reference architecture: N/A
 Network model: N/A
 Related projects installed: None
Additional information:
 None

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
status: New → Confirmed
importance: Undecided → High
milestone: none → 10.0
milestone: 10.0 → 9.0
tags: added: area-python
Dmitry Pyzhov (dpyzhov)
no longer affects: fuel/newton
Dmitry Pyzhov (dpyzhov)
Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Roman Prykhodchenko (romcheg)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-plugins (master)

Fix proposed to branch: master
Review: https://review.openstack.org/310230

Changed in fuel:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-plugins (master)

Reviewed: https://review.openstack.org/310230
Committed: https://git.openstack.org/cgit/openstack/fuel-plugins/commit/?id=83e764260fe95dc3cbffbd00f28401c1717f406a
Submitter: Jenkins
Branch: master

commit 83e764260fe95dc3cbffbd00f28401c1717f406a
Author: Roman Prykhodchenko <email address hidden>
Date: Tue Apr 26 16:54:14 2016 +0200

    Allow optional uninstall.sh

    Don't put any code to PREUN scripts if uninstall.sh
    does not exist or is empty.

    Closes-bug: #1574478
    Change-Id: Ie7767e285b8086921a944da4bea9aa9749a0e323

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Dmitry Pyzhov (dpyzhov) wrote :

Fixed in plugin builder, doesn't need backport

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.