summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-08-25 08:26:04 +0200
committerGitHub <noreply@github.com>2019-08-25 08:26:04 +0200
commitabd8adaa2c3839bbdb371c081e328da28a75a135 (patch)
treeb15942b52f98b5481f784f056ee18a01d4ad0d21 /src
parent2f3aa28f259ee7f23ef8a4a091db8ced2202bbd8 (diff)
parenta235b4453b4b0dde6d8da1d8b01aac1c5cdf3491 (diff)
downloadvyos-1x-abd8adaa2c3839bbdb371c081e328da28a75a135.tar.gz
vyos-1x-abd8adaa2c3839bbdb371c081e328da28a75a135.zip
Merge pull request #116 from jjakob/current
T1611: check if config node exists before getting value
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/interfaces/0-to-126
1 files changed, 14 insertions, 12 deletions
diff --git a/src/migration-scripts/interfaces/0-to-1 b/src/migration-scripts/interfaces/0-to-1
index 38f2bd8f5..96e18b5d5 100755
--- a/src/migration-scripts/interfaces/0-to-1
+++ b/src/migration-scripts/interfaces/0-to-1
@@ -30,20 +30,22 @@ else:
#
for br in config.list_nodes(base):
# STP: check if enabled
- stp_val = config.return_value(base + [br, 'stp'])
- # STP: delete node with old syntax
- config.delete(base + [br, 'stp'])
- # STP: set new node - if enabled
- if stp_val == "true":
- config.set(base + [br, 'stp'], value=None)
+ if config.exists(base + [br, 'stp']):
+ stp_val = config.return_value(base + [br, 'stp'])
+ # STP: delete node with old syntax
+ config.delete(base + [br, 'stp'])
+ # STP: set new node - if enabled
+ if stp_val == "true":
+ config.set(base + [br, 'stp'], value=None)
# igmp-snooping: check if enabled
- igmp_val = config.return_value(base + [br, 'igmp-snooping', 'querier'])
- # igmp-snooping: delete node with old syntax
- config.delete(base + [br, 'igmp-snooping', 'querier'])
- # igmp-snooping: set new node - if enabled
- if igmp_val == "enable":
- config.set(base + [br, 'igmp', 'querier'], value=None)
+ if config.exists(base + [br, 'igmp-snooping', 'querier']):
+ igmp_val = config.return_value(base + [br, 'igmp-snooping', 'querier'])
+ # igmp-snooping: delete node with old syntax
+ config.delete(base + [br, 'igmp-snooping', 'querier'])
+ # igmp-snooping: set new node - if enabled
+ if igmp_val == "enable":
+ config.set(base + [br, 'igmp', 'querier'], value=None)
#
# move interface based bridge-group to actual bridge (de-nest)