Add revert method in database_tasks MapLoadbalancerToAmphora

Partial-Bug: #1567463

Change-Id: I8c79d418d9523f8c3ccdabed9a89a40982c7b25a
(cherry picked from commit bc5b2d0e46)
This commit is contained in:
chen-li 2016-06-23 03:19:23 -05:00 committed by KRISHNA MOULI. TANKALA
parent a05727e367
commit 58ca8187dd
1 changed files with 8 additions and 0 deletions

View File

@ -430,6 +430,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."""