diff --git a/src/device/service/drivers/openconfig/OpenConfigDriver.py b/src/device/service/drivers/openconfig/OpenConfigDriver.py index 99ae1c8db2978e9a9fa3341eeed911f72b41130d..793b292c737a1b5f491937ece1200341eb7e6ae4 100644 --- a/src/device/service/drivers/openconfig/OpenConfigDriver.py +++ b/src/device/service/drivers/openconfig/OpenConfigDriver.py @@ -227,10 +227,10 @@ def edit_config( resource_key,resource_value = resource chk_string(str_resource_name + '.key', resource_key, allow_empty=False) - str_config_messages = compose_config( # get template for configuration - resource_key, resource_value, delete=delete, vendor=netconf_handler.vendor, message_renderer='pyangbind') # str_config_messages = compose_config( # get template for configuration - # resource_key, resource_value, delete=delete, vendor=netconf_handler.vendor, message_renderer=netconf_handler.message_renderer) + # resource_key, resource_value, delete=delete, vendor=netconf_handler.vendor, message_renderer='pyangbind') + str_config_messages = compose_config( # get template for configuration + resource_key, resource_value, delete=delete, vendor=netconf_handler.vendor, message_renderer=netconf_handler.message_renderer) for str_config_message in str_config_messages: # configuration of the received templates if str_config_message is None: raise UnsupportedResourceKeyException(resource_key) logger.debug('[{:s}] str_config_message[{:d}] = {:s}'.format( diff --git a/src/device/service/drivers/openconfig/templates/__init__.py b/src/device/service/drivers/openconfig/templates/__init__.py index dcd3cf6836ca41fce3e2b54ead209daeafa4355d..8df8fa28f53b291866dcc515e0211eec96d8e1f5 100644 --- a/src/device/service/drivers/openconfig/templates/__init__.py +++ b/src/device/service/drivers/openconfig/templates/__init__.py @@ -118,17 +118,21 @@ def compose_config( # template generation templates =[] if "acl_ruleset" in resource_key: # MANAGING ACLs if True: #vendor == 'ipinfusion': #! ipinfusion proprietary netconf receipe is used temporarily + enable_ingress_filter_path = 'acl/interfaces/ingress/enable_ingress_filter.xml' acl_entry_path = 'acl/acl-set/acl-entry/edit_config_ipinfusion_proprietary.xml' acl_ingress_path = 'acl/interfaces/ingress/edit_config_ipinfusion_proprietary.xml' data : Dict[str, Any] = acl_cr_to_dict_ipinfusion_proprietary(resource_value, delete=delete) else: + enable_ingress_filter_path = 'acl/interfaces/ingress/enable_ingress_filter.xml' acl_entry_path = 'acl/acl-set/acl-entry/edit_config.xml' acl_ingress_path = 'acl/interfaces/ingress/edit_config.xml' data : Dict[str, Any] = acl_cr_to_dict(resource_value, delete=delete) if delete: # unpair acl and interface before removing acl templates.append(JINJA_ENV.get_template(acl_ingress_path)) templates.append(JINJA_ENV.get_template(acl_entry_path)) + templates.append(JINJA_ENV.get_template(enable_ingress_filter_path)) else: + templates.append(JINJA_ENV.get_template(enable_ingress_filter_path)) templates.append(JINJA_ENV.get_template(acl_entry_path)) templates.append(JINJA_ENV.get_template(acl_ingress_path)) else: diff --git a/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/enable_ingress_filter.xml b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/enable_ingress_filter.xml new file mode 100644 index 0000000000000000000000000000000000000000..274028657547dd31d20654e2a59ac11554cb01d5 --- /dev/null +++ b/src/device/service/drivers/openconfig/templates/acl/interfaces/ingress/enable_ingress_filter.xml @@ -0,0 +1,9 @@ +<profiles xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-platform"> + <hardware-profile> + <filters> + <config> + <ingress-ipv4-extended {% if operation == "delete" %}operation="delete"{% endif %}></ingress-ipv4-extended> + </config> + </filters> + </hardware-profile> +</profiles> \ No newline at end of file