summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2022-12-26 17:10:40 +0200
committerzsdc <taras@vyos.io>2022-12-26 17:10:40 +0200
commit03a2ab8bbe647dda541c8eb3a4e38df3821f1fd1 (patch)
tree3fe339bcc4ed915910180b953d67b041b7bbe232 /cloudinit
parent3e5ae5fe3b2038bb809ab267a945346cfe1d0d79 (diff)
downloadvyos-cloud-init-03a2ab8bbe647dda541c8eb3a4e38df3821f1fd1.tar.gz
vyos-cloud-init-03a2ab8bbe647dda541c8eb3a4e38df3821f1fd1.zip
user-data: T4895: Fixed tag nodes processing
This commit fixes the problem with overwritting tag nodes by neighbors, when there are more than one tag node on the same level.
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/cc_vyos_userdata.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cloudinit/config/cc_vyos_userdata.py b/cloudinit/config/cc_vyos_userdata.py
index 5ad27b31..21deb3d6 100644
--- a/cloudinit/config/cc_vyos_userdata.py
+++ b/cloudinit/config/cc_vyos_userdata.py
@@ -134,10 +134,12 @@ def mark_tag(config, node_path, tag_nodes):
# apply "set" command
def apply_command_set(config, tag_nodes, multi_nodes, command):
# if a node is multi type add value instead replacing
- replace_option = not inside_nodes_list(command['cmd_path'], multi_nodes)
+ replace_option = not inside_nodes_list(command['cmd_path'],
+ multi_nodes + tag_nodes)
if not replace_option:
- logger.debug("{} is a multi node, adding value".format(
- command['cmd_path']))
+ logger.debug(
+ "{} is a multi or tag node, adding value instead overwriting".
+ format(command['cmd_path']))
config.set(command['cmd_path'],
command['cmd_value'],