summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-01-11 20:59:54 +0100
committerChristian Poessinger <christian@poessinger.com>2022-01-11 23:50:42 +0100
commit391ce22b76190309f81e048ebffab778b0fdee1d (patch)
tree0b4e9d1dc0f33f743e89a8a9b42295e004321799 /src/migration-scripts
parent968afb9e67a2267d248af5c127c4086bcd80374e (diff)
downloadvyos-1x-391ce22b76190309f81e048ebffab778b0fdee1d.tar.gz
vyos-1x-391ce22b76190309f81e048ebffab778b0fdee1d.zip
migrator: interfaces: T4171: bugfix ConfigTreeError
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-xsrc/migration-scripts/interfaces/11-to-122
-rwxr-xr-xsrc/migration-scripts/interfaces/12-to-132
-rwxr-xr-xsrc/migration-scripts/interfaces/22-to-232
-rwxr-xr-xsrc/migration-scripts/interfaces/9-to-102
4 files changed, 8 insertions, 0 deletions
diff --git a/src/migration-scripts/interfaces/11-to-12 b/src/migration-scripts/interfaces/11-to-12
index 0dad24642..ca4ebe741 100755
--- a/src/migration-scripts/interfaces/11-to-12
+++ b/src/migration-scripts/interfaces/11-to-12
@@ -31,6 +31,8 @@ if __name__ == '__main__':
config_file = f.read()
config = ConfigTree(config_file)
+ if not config.exists(['interfaces']):
+ exit(0)
for type in config.list_nodes(['interfaces']):
for interface in config.list_nodes(['interfaces', type]):
diff --git a/src/migration-scripts/interfaces/12-to-13 b/src/migration-scripts/interfaces/12-to-13
index f866ca9a6..fbd7e6f47 100755
--- a/src/migration-scripts/interfaces/12-to-13
+++ b/src/migration-scripts/interfaces/12-to-13
@@ -33,6 +33,8 @@ if __name__ == '__main__':
config_file = f.read()
config = ConfigTree(config_file)
+ if not config.exists(['interfaces']):
+ exit(0)
#
# T2903
diff --git a/src/migration-scripts/interfaces/22-to-23 b/src/migration-scripts/interfaces/22-to-23
index 06e07572f..734aa1fd8 100755
--- a/src/migration-scripts/interfaces/22-to-23
+++ b/src/migration-scripts/interfaces/22-to-23
@@ -84,6 +84,8 @@ if __name__ == '__main__':
config_file = f.read()
config = ConfigTree(config_file)
+ if not config.exists(['interfaces']):
+ exit(0)
#
# Migrate "interface ethernet eth0 ip ospf" to "protocols ospf interface eth0"
diff --git a/src/migration-scripts/interfaces/9-to-10 b/src/migration-scripts/interfaces/9-to-10
index 4aa2c42b5..c6311a24d 100755
--- a/src/migration-scripts/interfaces/9-to-10
+++ b/src/migration-scripts/interfaces/9-to-10
@@ -32,6 +32,8 @@ if __name__ == '__main__':
config_file = f.read()
config = ConfigTree(config_file)
+ if not config.exists(['interfaces']):
+ exit(0)
for intf_type in config.list_nodes(['interfaces']):
for intf in config.list_nodes(['interfaces', intf_type]):