Add revert method in database_tasks MapLoadbalancerToAmphora

Partial-Bug: #1567463

Change-Id: I8c79d418d9523f8c3ccdabed9a89a40982c7b25a
This commit is contained in:
chen-li 2016-06-23 03:19:23 -05:00
parent ebf88b65fb
commit bc5b2d0e46
1 changed files with 8 additions and 0 deletions

View File

@ -427,6 +427,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 in DB."""