Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Update gateway firewall service
Browse files Browse the repository at this point in the history
Enable user to create firewall service in case `any` provided for
`source` or `destination` values

Work towards: #165

Signed-off-by: mukultaneja <mtaneja@vmware.com>
  • Loading branch information
mukultaneja committed Feb 5, 2021
1 parent 47c67a6 commit 5a08bf8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module_utils/gateway_firewall_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] == 'any':
return ['any']
response.append("{0}:{1}".format(value[0], route))

return response
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 5a08bf8

Please sign in to comment.