Unnecessary conflict wrapper on assignment driver delete_project() method

Bug #1410029 reported by Henry Nash
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Invalid
Low
Annapoornima Koppad

Bug Description

The assignment driver method delete_project [1] is protected by the sql.handle_conflicts wrapper - but that wrapper doesn't do anything for the delete case - and we don't use it for any other delete_entity() method other than project. We should remove this wrapper protection.

https://github.com/openstack/keystone/blob/f468f32d8f5fa3f01799e5ad3022eb8e065dc32a/keystone/resource/backends/sql.py#L164

Henry Nash (henry-nash)
Changed in keystone:
importance: Undecided → Low
assignee: nobody → Henry Nash (henry-nash)
Changed in keystone:
status: New → Confirmed
description: updated
Changed in keystone:
milestone: none → kilo-rc1
Changed in keystone:
milestone: kilo-rc1 → none
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (master)

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

Changed in keystone:
assignee: Henry Nash (henry-nash) → Ajaya Agrawal (ajayaa)
status: Confirmed → In Progress
description: updated
tags: added: low-hanging-fruit
Revision history for this message
Samuel de Medeiros Queiroz (samueldmq) wrote :

In the regard of wrapping DB duplicate entry exceptions [1], it really doesn't do anything for delete. However, it also wraps any other DB exception (eg IntegrityError) into a HTTP 500 UnexpectedError with a custom message.

In my opinion it is worth it to keep this, and even add to any other methods that still don't have it.
Creating another wrapper only containing [2] may be a better option, making it clearer.

[1] https://github.com/openstack/keystone/blob/master/keystone/common/sql/core.py#L437-L444

[2] https://github.com/openstack/keystone/blob/master/keystone/common/sql/core.py#L445-L461

Revision history for this message
Sean Perry (sean-perry-a) wrote :

@samueldmq, the lines you refer to in sql/core.py are no longer present. What were you trying to say would be best practice?

Revision history for this message
Samuel de Medeiros Queiroz (samueldmq) wrote :
Revision history for this message
Steve Martinelli (stevemar) wrote :

Automatically unassigning due to inactivity.

Changed in keystone:
assignee: Ajaya Agrawal (ajayaa) → nobody
status: In Progress → Triaged
Changed in keystone:
assignee: nobody → Annapoornima Koppad (annakoppad)
Revision history for this message
Adam Young (ayoung) wrote :

Not a bugf, leave the wrapper in for SQL message reporting.

Changed in keystone:
status: Triaged → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on keystone (master)

Change abandoned by Steve Martinelli (<email address hidden>) on branch: master
Review: https://review.openstack.org/247017
Reason: no action in 5 months and bug is marked as invalid, auto-abandoning

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.