Merge "Add revert method in database_tasks MapLoadbalancerToAmphora"

This commit is contained in:
Jenkins 2016-07-16 03:05:59 +00:00 committed by Gerrit Code Review
commit 5818119df3
1 changed files with 8 additions and 0 deletions

View File

@ -478,6 +478,14 @@ class MapLoadbalancerToAmphora(BaseDatabaseTask):
return amp.id
def revert(self, result, loadbalancer_id, *args, **kwargs):
LOG.warning(_LW("Reverting Amphora allocation for the load "
"balancer %s in the database."), loadbalancer_id)
self.loadbalancer_repo.update(db_apis.get_session(),
loadbalancer_id,
provisioning_status=constants.ERROR)
class _MarkAmphoraRoleAndPriorityInDB(BaseDatabaseTask):
"""Alter the amphora role and priority in DB."""