Fixes Octavia flows that are not reverting

Some of the revert methods on tasks inside Octavia are missing
required parameters.  This causes the revert to fail.
This patch corrects those revert methods.

Closes-Bug: #1527428

Change-Id: I2accbe55db710a312d31be5f3da8e06b7ab79025
This commit is contained in:
Michael Johnson 2015-12-18 16:57:28 +00:00
parent 4a460b3b45
commit 02528f5fa9
2 changed files with 10 additions and 10 deletions

View File

@ -324,7 +324,7 @@ class AssociateFailoverAmphoraWithLBID(BaseDatabaseTask):
load_balancer_id=loadbalancer_id,
amphora_id=amphora_id)
def revert(self, amphora_id):
def revert(self, amphora_id, *args, **kwargs):
self.repos.amphora.update(db_apis.get_session(), amphora_id,
loadbalancer_id=None)
@ -367,7 +367,7 @@ class _MarkAmphoraRoleAndPriorityInDB(BaseDatabaseTask):
role=amp_role,
vrrp_priority=vrrp_priority)
def _revert(self, result, amphora):
def _revert(self, result, amphora, *args, **kwargs):
"""Assigns None role and vrrp_priority."""
if isinstance(result, failure.Failure):
@ -389,8 +389,8 @@ class MarkAmphoraMasterInDB(_MarkAmphoraRoleAndPriorityInDB):
amp_role = constants.ROLE_MASTER
self._execute(amphora, amp_role, constants.ROLE_MASTER_PRIORITY)
def revert(self, result, amphora):
self._revert(result, amphora)
def revert(self, result, amphora, *args, **kwargs):
self._revert(result, amphora, *args, **kwargs)
class MarkAmphoraBackupInDB(_MarkAmphoraRoleAndPriorityInDB):
@ -400,8 +400,8 @@ class MarkAmphoraBackupInDB(_MarkAmphoraRoleAndPriorityInDB):
amp_role = constants.ROLE_BACKUP
self._execute(amphora, amp_role, constants.ROLE_BACKUP_PRIORITY)
def revert(self, result, amphora):
self._revert(result, amphora)
def revert(self, result, amphora, *args, **kwargs):
self._revert(result, amphora, *args, **kwargs)
class MarkAmphoraStandAloneInDB(_MarkAmphoraRoleAndPriorityInDB):
@ -411,8 +411,8 @@ class MarkAmphoraStandAloneInDB(_MarkAmphoraRoleAndPriorityInDB):
amp_role = constants.ROLE_STANDALONE
self._execute(amphora, amp_role, None)
def revert(self, result, amphora):
self._revert(result, amphora)
def revert(self, result, amphora, *args, **kwargs):
self._revert(result, amphora, *args, **kwargs)
class MarkAmphoraAllocatedInDB(BaseDatabaseTask):

View File

@ -156,7 +156,7 @@ class PlugNetworks(BaseNetworkTask):
self.network_driver.plug_network(amphora.compute_id,
nic.network_id)
def revert(self, amphora, delta):
def revert(self, amphora, delta, *args, **kwargs):
"""Handle a failed network plug by removing all nics added."""
LOG.warn(_LW("Unable to plug networks for amp id %s"), amphora.id)
@ -248,7 +248,7 @@ class HandleNetworkDeltas(BaseNetworkTask):
LOG.exception(_LE("Unable to unplug network"))
return added_ports
def revert(self, result, deltas):
def revert(self, result, deltas, *args, **kwargs):
"""Handle a network plug or unplug failures."""
if isinstance(result, failure.Failure):