summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-03-22 14:20:34 +0100
committerGitHub <noreply@github.com>2024-03-22 14:20:34 +0100
commitf61f9e5c31c76b33dc0a67627bab98605a2b5be4 (patch)
tree06fb85ed6c1550a9c60fcf99b02dd2a67a28a566
parentf7a005ebecdfabc0a0af75ed9ad84b44ef1d6d5b (diff)
parent9f3d89349cd8efd49797bf52ef169911869631d3 (diff)
downloadvyos-1x-f61f9e5c31c76b33dc0a67627bab98605a2b5be4.tar.gz
vyos-1x-f61f9e5c31c76b33dc0a67627bab98605a2b5be4.zip
Merge pull request #3166 from vyos/mergify/bp/sagitta/pr-3153
policy: T6130: Revert commit 960cace (backport #3153)
-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: