diff --git a/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml b/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml new file mode 100644 index 00000000..3c564707 --- /dev/null +++ b/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml @@ -0,0 +1,2 @@ +bugfixes: + - api_info, api_modify - fields ``log`` and ``log-prefix`` in paths ``ip firewall filter``, ``ip firewall mangle``, ``ip firewall nat``, ``ip firewall raw`` now have the correct default values (https://github.com/ansible-collections/community.routeros/pull/324). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 929aa195..bf0d3358 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2986,8 +2986,8 @@ def join_path(path): 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), @@ -3057,8 +3057,8 @@ def join_path(path): 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'new-connection-mark': KeyInfo(can_disable=True), 'new-dscp': KeyInfo(can_disable=True), 'new-mss': KeyInfo(can_disable=True), @@ -3137,8 +3137,8 @@ def join_path(path): 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), @@ -3200,8 +3200,8 @@ def join_path(path): 'ipv4-options': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), diff --git a/tests/unit/plugins/modules/test_api_find_and_modify.py b/tests/unit/plugins/modules/test_api_find_and_modify.py index 2f47af4f..e6eb00bc 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -620,6 +620,8 @@ def test_change_remove_generic(self): 'comment': 'defconf', 'protocol': 'icmp', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*3', @@ -627,6 +629,8 @@ def test_change_remove_generic(self): 'chain': 'input', 'comment': 'defconf', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*4', @@ -634,6 +638,8 @@ def test_change_remove_generic(self): 'chain': 'input', 'comment': 'defconf', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*7', @@ -642,6 +648,8 @@ def test_change_remove_generic(self): 'comment': 'defconf', 'disabled': False, 'in-interface': 'wan', + 'log': False, + 'log-prefix': '', }, { '.id': '*8', @@ -650,6 +658,8 @@ def test_change_remove_generic(self): 'comment': 'defconf', 'connection-state': 'established', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*9', @@ -658,6 +668,8 @@ def test_change_remove_generic(self): 'comment': 'defconf', 'connection-state': 'related', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*A', @@ -666,6 +678,8 @@ def test_change_remove_generic(self): 'comment': 'defconf', 'connection-status': 'invalid', 'disabled': False, + 'log': False, + 'log-prefix': '', }, ]) self.assertEqual(result['match_count'], 3)