Add abstract method in trusts base.py

This is a follow-up patch to add an abstract
method for flush_expired_and_soft_deleted_trusts
in base.py to avoid any burst in case people
supplying their own backend.

Change-Id: Ib326abddce239e87cd4cd37d06fa3b55112ee134
Related-Patch: https://review.openstack.org/#/c/589378/
Related-Bug: #1473292
This commit is contained in:
Vishakha Agarwal 2018-11-01 14:20:33 +05:30
parent efd67a0293
commit 25e0e1474a
2 changed files with 22 additions and 4 deletions

View File

@ -79,3 +79,19 @@ class TrustDriverBase(object):
""" """
raise exception.NotImplemented() # pragma: no cover raise exception.NotImplemented() # pragma: no cover
@abc.abstractmethod
def flush_expired_and_soft_deleted_trusts(self, project_id=None,
trustor_user_id=None,
trustee_user_id=None,
date=None):
"""Flush expired and non-expired soft deleted trusts from the backend.
:param project_id: ID of a project to filter trusts by.
:param trustor_user_id: ID of a trustor_user_id to filter trusts by.
:param trustee_user_id: ID of a trustee_user_id to filter trusts by.
:param date: date to filter trusts by.
:type date: datetime
"""
raise exception.NotImplemented() # pragma: no cover

View File

@ -1,7 +1,7 @@
--- ---
feature: feature:
- | - |
[`Bug 1473292 <https://bugs.launchpad.net/keystone/+bug/1473292>`_] [`bug 1473292 <https://bugs.launchpad.net/keystone/+bug/1473292>`_]
As trusts created by user are stored in database resulting it to grow larger As trusts created by user are stored in database resulting it to grow larger
as trusts that are expired and soft deleted non-expired are not automatically as trusts that are expired and soft deleted non-expired are not automatically
purged by keystone.Thus this implements TrustFlush via keystone-manage to delete purged by keystone.Thus this implements TrustFlush via keystone-manage to delete
@ -18,6 +18,8 @@ feature:
--trustee-user-id <string>: To purge trusts of given trustee-id. --trustee-user-id <string>: To purge trusts of given trustee-id.
--date <string>: To purge trusts older than date. It will purge trusts older than --date <string>: To purge trusts older than date. It will purge trusts older than
current if date not given. current if date not given.
other:
- >
[`bug 1473292 <https://bugs.launchpad.net/keystone/+bug/1473292>`_]
If you're relying on a custom implementation of the trust backend, please be sure to
implement the new method prior to upgrading.