From 66bc61e9cdde73f7d45c61124e98df700b716d26 Mon Sep 17 00:00:00 2001 From: mukultaneja Date: Sat, 6 Feb 2021 03:06:34 +0530 Subject: [PATCH] Update gateway firewall service Enable user to create firewall service in case `any` provided for `source` or `destination` values Work towards: #165 Signed-off-by: mukultaneja --- module_utils/gateway_firewall_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module_utils/gateway_firewall_service.py b/module_utils/gateway_firewall_service.py index 7d43279..0ec218b 100644 --- a/module_utils/gateway_firewall_service.py +++ b/module_utils/gateway_firewall_service.py @@ -77,6 +77,8 @@ def _prepare_route_values(self, route_values): if route_values is not None: for route_value in route_values: for route, value in route_value.items(): + if value[0].lower() == 'any': + return ['any'] response.append("{0}:{1}".format(value[0], route)) return response @@ -139,6 +141,8 @@ def update(self, service_params=None): source_values = self._prepare_route_values(source_values) destination_values = self._prepare_route_values( destination_values) + if 'any' in destination_values or 'any' in source_values: + continue firewall_rule.edit(source_values=source_values, services=services, destination_values=destination_values,