summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-04-20 16:25:36 +0200
committerChristian Poessinger <christian@poessinger.com>2019-04-20 16:26:52 +0200
commitf8b7e3b2b20d143643bfac72db68943dfc9046f1 (patch)
tree53e95284387f44756565951d192bc39f886bbfd2
parent27c4afd725a3024f72fafc11bd1d5b88bbbeabe9 (diff)
downloadvyos-1x-f8b7e3b2b20d143643bfac72db68943dfc9046f1.tar.gz
vyos-1x-f8b7e3b2b20d143643bfac72db68943dfc9046f1.zip
[dhcp-server] T1335: bugfix when migrating authoritative section
-rwxr-xr-xsrc/migration-scripts/dhcp-server/4-to-58
1 files changed, 5 insertions, 3 deletions
diff --git a/src/migration-scripts/dhcp-server/4-to-5 b/src/migration-scripts/dhcp-server/4-to-5
index 8b973d608..baccd5a2b 100755
--- a/src/migration-scripts/dhcp-server/4-to-5
+++ b/src/migration-scripts/dhcp-server/4-to-5
@@ -105,11 +105,13 @@ else:
# Make node "set service dhcp-server shared-network-name <xyz> authoritative" valueless
if config.exists(['service', 'dhcp-server', 'shared-network-name', network, 'authoritative']):
- bool_val = config.return_value(['service', 'dhcp-server', 'shared-network-name', network, 'authoritative'])
+ authoritative = config.return_value(['service', 'dhcp-server', 'shared-network-name', network, 'authoritative'])
+
# Delete the node with the old syntax
config.delete(['service', 'dhcp-server', 'shared-network-name', network, 'authoritative'])
- if str(bool_val) == 'true':
- # Recreate node with new syntax
+
+ # Recreate node with new syntax - if required
+ if authoritative == "enable":
config.set(['service', 'dhcp-server', 'shared-network-name', network, 'authoritative'])
try: