summaryrefslogtreecommitdiff
path: root/src/migration-scripts/rpki
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-02-07 14:48:42 +0100
committerChristian Poessinger <christian@poessinger.com>2021-02-07 14:50:40 +0100
commitb50a88884e642a4747327402cd5cff696d440918 (patch)
tree88345d702f321e68fe3696e1114da20865b80771 /src/migration-scripts/rpki
parentec74ae6c8924c4b09aaca2c4df206904bb335d1a (diff)
downloadvyos-1x-b50a88884e642a4747327402cd5cff696d440918.tar.gz
vyos-1x-b50a88884e642a4747327402cd5cff696d440918.zip
rpki: T3293: bugfix for config migration when cache and address name match
If the RPKI cache name equals the configured address, renaming is not possible, as rename expects the new path to not exist. (cherry picked from commit af2a22fb114b7d00f50fb32dc64b49e132ccca61)
Diffstat (limited to 'src/migration-scripts/rpki')
-rwxr-xr-xsrc/migration-scripts/rpki/0-to-17
1 files changed, 6 insertions, 1 deletions
diff --git a/src/migration-scripts/rpki/0-to-1 b/src/migration-scripts/rpki/0-to-1
index 9058af016..5b4893205 100755
--- a/src/migration-scripts/rpki/0-to-1
+++ b/src/migration-scripts/rpki/0-to-1
@@ -48,7 +48,12 @@ if config.exists(base + ['cache']):
# Increase preference for the next caching peer - actually VyOS 1.2
# supported only one but better save then sorry (T3253)
preference += 1
- config.rename(base + ['cache', cache], address)
+
+ # T3293: If the RPKI cache name equals the configured address,
+ # renaming is not possible, as rename expects the new path to not
+ # exist.
+ if not config.exists(base + ['cache', address]):
+ config.rename(base + ['cache', cache], address)
try:
with open(file_name, 'w') as f: