Skip to content

Commit

Permalink
Add control flag 'esd_auto_refresh' in configuration file
Browse files Browse the repository at this point in the history
Set 'esd_auto_refresh = False' and use command
"neutron lbaas-l7policy-update esd_demo_3 --action REJECT"
to trigger ESD file refresh manually.
  • Loading branch information
zhang-shengping committed Jun 10, 2019
1 parent 81995bd commit 22d40b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions f5_openstack_agent/lbaasv2/drivers/bigip/agent_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@
'password_cipher_mode',
default=False,
help='The flag indicating the password is plain text or not.'
),
cfg.BoolOpt(
'esd_auto_refresh',
default=True,
help='Enable ESD file periodic refresh'
)
]

Expand Down Expand Up @@ -499,8 +504,9 @@ def connect_driver(self, context):

@periodic_task.periodic_task(spacing=PERIODIC_TASK_INTERVAL)
def refresh_esd(self, context):
if self.lbdriver.esd:
LOG.debug("refresh esd files")
"""Refresh ESD files."""
if self.lbdriver.esd and self.conf.esd_auto_refresh:
LOG.debug("refresh ESD files")
self.lbdriver.init_esd()

@periodic_task.periodic_task(spacing=PERIODIC_TASK_INTERVAL)
Expand Down
2 changes: 2 additions & 0 deletions f5_openstack_agent/lbaasv2/drivers/bigip/icontrol_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,6 +2408,8 @@ def create_l7policy(self, l7policy, service):
@is_operational
def update_l7policy(self, old_l7policy, l7policy, service):
"""Update lb l7policy."""
if not self.conf.esd_auto_refresh:
self.init_esd()
LOG.debug("Updating l7policy")
self._common_service_handler(service)

Expand Down

0 comments on commit 22d40b7

Please sign in to comment.