Check for default rotation policy before updating db (#1223)

This commit is contained in:
Zach Seils
2018-04-24 19:55:26 -04:00
committed by kevgliss
parent 91500d1022
commit 3e5db9eedb
2 changed files with 19 additions and 5 deletions

View File

@ -18,6 +18,15 @@ def get(policy_id):
return database.get(RotationPolicy, policy_id)
def get_by_name(policy_name):
"""
Retrieves policy by its name.
:param policy_name:
:return:
"""
return database.get_all(RotationPolicy, policy_name, field='name').all()
def delete(policy_id):
"""
Delete a rotation policy.