summaryrefslogtreecommitdiff
path: root/src/migration-scripts/policy/3-to-4
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2024-03-19 15:04:22 +0200
committeraapostoliuk <a.apostoliuk@vyos.io>2024-03-19 15:38:46 +0200
commit72378c67ef1eee01a06e2f9a194a0870c6a7fdd2 (patch)
tree99e9fb14fa3af5024c9c5fe7585acfb79cc33613 /src/migration-scripts/policy/3-to-4
parent4912dfbfa5ef52eb8a6c7d54bb23e0092dffb4f2 (diff)
downloadvyos-1x-72378c67ef1eee01a06e2f9a194a0870c6a7fdd2.tar.gz
vyos-1x-72378c67ef1eee01a06e2f9a194a0870c6a7fdd2.zip
policy: T6130: Revert commit 960cace
This reverts commit 960cace189d7ace2bea0968646b1348b415e0363. All community rules syntax was changed. T5357 is invalid bug report. VyOS cannot use new configuration syntax in the previous versions.
Diffstat (limited to 'src/migration-scripts/policy/3-to-4')
-rwxr-xr-xsrc/migration-scripts/policy/3-to-48
1 files changed, 3 insertions, 5 deletions
diff --git a/src/migration-scripts/policy/3-to-4 b/src/migration-scripts/policy/3-to-4
index 1ebb248b0..476fa3af2 100755
--- a/src/migration-scripts/policy/3-to-4
+++ b/src/migration-scripts/policy/3-to-4
@@ -51,7 +51,7 @@ def community_migrate(config: ConfigTree, rule: list[str]) -> bool:
:rtype: bool
"""
community_list = list((config.return_value(rule)).split(" "))
-
+ config.delete(rule)
if 'none' in community_list:
config.set(rule + ['none'])
return False
@@ -61,10 +61,8 @@ def community_migrate(config: ConfigTree, rule: list[str]) -> bool:
community_action = 'add'
community_list.remove('additive')
for community in community_list:
- if len(community):
- config.set(rule + [community_action], value=community,
- replace=False)
- config.delete(rule)
+ config.set(rule + [community_action], value=community,
+ replace=False)
if community_action == 'replace':
return False
else: