summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Fort <nicolasfort1988@gmail.com>2023-06-01 12:49:21 +0000
committerNicolas Fort <nicolasfort1988@gmail.com>2023-08-11 11:50:00 -0300
commit68694d022d8f63cfeef42430220efc56d4a1433c (patch)
treec88e6c59d6588ae5ccef715f4a40f43c6f3dd0ad
parentd898739b78f4563b3e170684bbc1d248c62553fe (diff)
downloadvyos-1x-68694d022d8f63cfeef42430220efc56d4a1433c.tar.gz
vyos-1x-68694d022d8f63cfeef42430220efc56d4a1433c.zip
T5160: firewal refactor: fix tabulation for geo-ip parsing code. Typo fix in firewall smoketest
-rw-r--r--python/vyos/firewall.py12
-rwxr-xr-xsmoketest/scripts/cli/test_firewall.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index bb32556af..b028f0af0 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -521,12 +521,12 @@ def geoip_update(firewall, force=False):
set_name = f'GEOIP_CC_{path[1]}_{path[2]}_{path[4]}'
if path[1] == 'ipv6_name':
set_name = f'GEOIP_CC_name6_{path[2]}_{path[4]}'
- if ( path[0] == 'ipv4' ) and ( path[1] == 'forward' or path[1] == 'input' or path[1] == 'output' or path[1] == 'name' ):
- for code in codes:
- ipv4_codes.setdefault(code, []).append(set_name)
- elif ( path[0] == 'ipv6' ) and ( path[1] == 'forward' or path[1] == 'input' or path[1] == 'output' or path[1] == 'ipv6_name' ):
- for code in codes:
- ipv6_codes.setdefault(code, []).append(set_name)
+ if ( path[0] == 'ipv4' ) and ( path[1] == 'forward' or path[1] == 'input' or path[1] == 'output' or path[1] == 'name' ):
+ for code in codes:
+ ipv4_codes.setdefault(code, []).append(set_name)
+ elif ( path[0] == 'ipv6' ) and ( path[1] == 'forward' or path[1] == 'input' or path[1] == 'output' or path[1] == 'ipv6_name' ):
+ for code in codes:
+ ipv6_codes.setdefault(code, []).append(set_name)
if not ipv4_codes and not ipv6_codes:
if force:
diff --git a/smoketest/scripts/cli/test_firewall.py b/smoketest/scripts/cli/test_firewall.py
index 7a7628873..bd7666313 100755
--- a/smoketest/scripts/cli/test_firewall.py
+++ b/smoketest/scripts/cli/test_firewall.py
@@ -274,8 +274,8 @@ class TestFirewall(VyOSUnitTestSHIM.TestCase):
name2 = 'smoketest-adv2'
interface = 'eth0'
- self.cli_set(['firewall', 'ip4', 'name', name, 'default-action', 'drop'])
- self.cli_set(['firewall', 'ip4', 'name', name, 'enable-default-log'])
+ self.cli_set(['firewall', 'ipv4', 'name', name, 'default-action', 'drop'])
+ self.cli_set(['firewall', 'ipv4', 'name', name, 'enable-default-log'])
self.cli_set(['firewall', 'ipv4', 'name', name, 'rule', '6', 'action', 'accept'])
self.cli_set(['firewall', 'ipv4', 'name', name, 'rule', '6', 'packet-length', '64'])