Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions f5_openstack_agent/lbaasv2/drivers/bigip/irule.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_irule_full_path(self, service, vip, prefix):
return irule_fullPath

def create_specific_irule(self, service, vip, bigip, prefix=None,
apiAnonymous=None):
apiAnonymous=None, delete=False):
irule_partition = vip['partition']
irule_name = self.get_irule_name(service, prefix)
irule_fullPath = "/" + irule_partition + "/" + irule_name
Expand All @@ -125,6 +125,15 @@ def create_specific_irule(self, service, vip, bigip, prefix=None,
partition=irule_partition
)

# NOTE(xxx) the 'delete' arguement and this odd snippet for
# leftover TOA irule campatibility. it will update leftover TOA irule
# to new form. Maybe delete this snippet in futrue.
if delete and irule_exists:
self.irule_helper.delete(
partition=irule_partition,
name=irule_name
)

if not irule_exists:
payload = dict(
name=irule_name,
Expand Down Expand Up @@ -160,7 +169,7 @@ def create_iRule(self, service, vip, bigip, **kwargs):

irule_fullPath = self.create_specific_irule(
service, vip, bigip, prefix="TOA",
apiAnonymous=irule_apiAnonymous)
apiAnonymous=irule_apiAnonymous, delete=True)
if vip['rules']:
if irule_fullPath not in vip['rules']:
vip['rules'].append(irule_fullPath)
Expand Down