-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
confd: bump version for phys-address .cfg migration
See issue #680 Signed-off-by: Joachim Wiberg <[email protected]>
- Loading branch information
Showing
5 changed files
with
21 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/confd/share/migrate/1.2/10-ietf-interfaces-phys-address.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/sh | ||
# Migrate phys-address -> custom-phys-address with static option | ||
|
||
file=$1 | ||
temp=${file}.tmp | ||
|
||
jq '( | ||
.["ietf-interfaces:interfaces"].interface[] |= | ||
if has("phys-address") then | ||
.["infix-interfaces:custom-phys-address"] = { "static": .["phys-address"] } | del(.["phys-address"]) | ||
else | ||
. | ||
end | ||
)' "$file" > "$temp" && | ||
mv "$temp" "$file" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
migratedir = $(pkgdatadir)/migrate/1.2 | ||
dist_migrate_DATA = 10-ietf-interfaces-phys-address.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
SUBDIRS = 1.0 1.1 | ||
SUBDIRS = 1.0 1.1 1.2 | ||
migratedir = $(pkgdatadir)/migrate |