Prevent used node profiles from being deleted

Bug #1302019 reported by Ana Krivokapić
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tuskar-ui
Fix Committed
High
Ana Krivokapić

Bug Description

Node profiles which are assigned to a role should be impossible to delete.

Revision history for this message
Ana Krivokapić (akrivoka) wrote :

I tried to delete a node profile which was in use - the UI behaves correctly in this case. It stopped me from deleting it with the message "You are not allowed to delete node profile: baremetal".

Changed in tuskar-ui:
status: Triaged → Invalid
Revision history for this message
Tzu-Mainn Chen (tzumainn) wrote :

It looks like the check is based on deployed servers:

class Flavor {

.
.
.

    @classmethod
    @memoized.memoized
    @handle_errors(_("Unable to retrieve existing servers list."), [])
    def list_deployed_ids(cls, request):
        """Get and memoize ID's of deployed flavors."""
        servers = nova.server_list(request)[0]
        return set(server.flavor['id'] for server in servers)

Should it also be based on whether a flavor is associated with a role?

Revision history for this message
Ana Krivokapić (akrivoka) wrote :

If it's possible for a flavor to be associated with a role, but not deployed on a server, then yes. I will investigate.

Changed in tuskar-ui:
status: Invalid → Incomplete
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tuskar-ui (master)

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

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

Reviewed: https://review.openstack.org/86018
Committed: https://git.openstack.org/cgit/openstack/tuskar-ui/commit/?id=1625b16b0404e8f01b2cc1e82f717dccf3bbb3bb
Submitter: Jenkins
Branch: master

commit 1625b16b0404e8f01b2cc1e82f717dccf3bbb3bb
Author: Ana Krivokapic <email address hidden>
Date: Tue Apr 8 14:23:45 2014 +0200

    Prevent used flavor from being deleted

    When a flavor deletion is attempted, two checks are necessary:
    * ensure the flavor is not deployed on an instance
    * ensure the flavor is not associated with a deployment role

    This patch adds the second check which was missing.

    Change-Id: I8c9610a4245b617cae281b44084d1a93b4699c2c
    Closes-bug: #1302019

Changed in tuskar-ui:
status: In Progress → Fix Committed
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.