Skip to content

Commit

Permalink
fix static routes override
Browse files Browse the repository at this point in the history
  • Loading branch information
charanm08 committed Jan 24, 2025
1 parent 1be2a37 commit 35d6645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion f5_cccl/resource/net/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Route(Resource):
properties = dict(name=None,
partition=None,
network=None,
gw=None)
gw=None,
description=None)

def __init__(self, name, partition, **data):
"""Create an Route entry from CCCL routeType."""
Expand Down
1 change: 1 addition & 0 deletions f5_cccl/service/config_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,6 @@ def read_net_config(self, service_config, default_route_domain):
a['name']: self._create_config_item(ApiRoute, a)
for a in routes
}
config_dict['cis-identifier'] = service_config.get('cis-identifier',str())

return config_dict
9 changes: 7 additions & 2 deletions f5_cccl/service/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ class ServiceConfigDeployer(object):

first_pass = True

def __init__(self, bigip_proxy):
def __init__(self, bigip_proxy,partition=None):
"""Initialize the config deployer."""
self._bigip = bigip_proxy
self._partition = partition

# pylint: disable=too-many-locals
def _get_resource_tasks(self, existing, desired):
Expand Down Expand Up @@ -485,6 +486,10 @@ def deploy_net(self, desired_config): # pylint: disable=too-many-locals
(create_routes, update_routes, delete_routes) = (
self._get_resource_tasks(existing, desired)[0:3])

if self._partition:
if self._partition.lower() == 'common' and len(delete_routes) > 0:
delete_routes = [x for x in delete_routes if x._data.get("description") == desired_config.get('cis-identifier')]

# Get the list of arp tasks
LOGGER.debug("Getting arp tasks...")
existing = self._bigip.get_arps()
Expand Down Expand Up @@ -648,7 +653,7 @@ def __init__(self, bigip_proxy, partition, schema):
self._partition = partition
self._bigip = bigip_proxy
self._config_validator = ServiceConfigValidator(schema)
self._service_deployer = ServiceConfigDeployer(bigip_proxy)
self._service_deployer = ServiceConfigDeployer(bigip_proxy,partition)
self._config_reader = ServiceConfigReader(self._partition)

def get_partition(self):
Expand Down

0 comments on commit 35d6645

Please sign in to comment.