Skip to content

Commit

Permalink
configuration migrate: Remove duplicate infix-meta:version when migra…
Browse files Browse the repository at this point in the history
…te config

when migrate configs the yang data produced was this:
  "infix-meta:meta": {
    version: "1.0"
    "infix-meta:version": "1.1"
  },

duplicate node, resulting in failed migration of startup configuration, always replace
whole node.
  • Loading branch information
mattiaswal committed Sep 20, 2024
1 parent 8c3ee6d commit 9755182
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ for version_dir in $(find "$MIGRATIONS_DIR" -mindepth 1 -maxdepth 1 -type d | so
done

# Update the JSON file to the latest version
if jq --arg version "$sys_version" '.["infix-meta:meta"]["infix-meta:version"] = $version' "$CONFIG_FILE" \
if jq --arg version "$sys_version" '.["infix-meta:meta"] = {"infix-meta:version": $version}' "$CONFIG_FILE" \
> "${CONFIG_FILE}.tmp" && mv "${CONFIG_FILE}.tmp" "$CONFIG_FILE"; then
note "Configuration updated to version $sys_version."
else
Expand Down

0 comments on commit 9755182

Please sign in to comment.