lp-delete-fixup-to-work-with-app

Bug #1497414 reported by Devdatta Kulkarni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Solum
Fix Released
High
Devdatta Kulkarni

Bug Description

In language_pack_handler's delete method we check if the language_pack is used or not by checking all the plans.

https://github.com/openstack/solum/blob/master/solum/api/handlers/language_pack_handler.py#L83

With introduction of apps and workflows, there are 'dummy' plans created when deploying the app.

https://github.com/openstack/solum/blob/master/solum/api/handlers/workflow_handler.py#L87

These plans don't have the 'raw_content' attribute on them.

So due to this the check being done in language_pack_handler's delete method fails.

There are several ways we can solve this.

1) Change the language_pack_handler's delete method to check for apps instead of plans. This is the preferred long-term option, which we would implement when all the functionality has been ported to use app instead of plan.

2) Modify creation of the dummy plan to add the required attributes (raw_content). This is not preferred as we don't want to add functionality to something which we may not be using going forward.

3) Add checks in the language_pack_handler's delete method to check for the existence of the required attributes ('raw_content'), and take the action only if the attribute is present. This is the option we are going to implement.

description: updated
Changed in solum:
assignee: nobody → Devdatta (devdatta-kulkarni)
importance: Undecided → High
Changed in solum:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to solum (master)

Reviewed: https://review.openstack.org/225281
Committed: https://git.openstack.org/cgit/openstack/solum/commit/?id=4d469df2d9b292c9b013a043ddb12fe855877288
Submitter: Jenkins
Branch: master

commit 4d469df2d9b292c9b013a043ddb12fe855877288
Author: Devdatta Kulkarni <email address hidden>
Date: Fri Sep 18 13:52:52 2015 -0500

    Languagepack delete fixup to work with app

    1) Modified language_pack_handler's delete method to accommodate
    plans and that are created in the background as part
    of app deployment invocations.

    2) Added a check to ensure that languagepack is deleted only
    if it not being used by any apps and any plans

    3) Changed a exception wrapper on the language_pack_controller's
    methods as it was obscuring the real error message and causing
    a spurious exception line to be generated in the solum-api
    log (Bug: 1498955)

    Change-Id: Iaa71159f9af319e4bab8cdee8d11558a8ab00650
    Closes-Bug: #1497414
    Closes-Bug: #1498955

Changed in solum:
status: In Progress → Fix Committed
Changed in solum:
milestone: none → 2015.1.2
Changed in solum:
milestone: 2015.1.2 → 4.0.0
Changed in solum:
status: Fix Committed → 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.