summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-18 21:48:53 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-18 21:48:53 +0200
commite2f9f4f4e8b2e961a58d935d09798ddb4e1e0460 (patch)
tree8256fc409b678ade7a730c55c05206b7728c2378 /src/migration-scripts
parenta4440bd589db645eb99f343a8163e188a700774c (diff)
downloadvyos-1x-e2f9f4f4e8b2e961a58d935d09798ddb4e1e0460.tar.gz
vyos-1x-e2f9f4f4e8b2e961a58d935d09798ddb4e1e0460.zip
dhcp-server: T3838: rename dns-server to name-server node
IPv4 DHCP uses "dns-server" to specify one or more name-servers for a given pool. In order to use the same CLI syntax this should be renamed to name-server, which is already the case for DHCPv6.
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-xsrc/migration-scripts/dhcp-server/5-to-67
1 files changed, 7 insertions, 0 deletions
diff --git a/src/migration-scripts/dhcp-server/5-to-6 b/src/migration-scripts/dhcp-server/5-to-6
index 4cd2ec07a..7f447ac17 100755
--- a/src/migration-scripts/dhcp-server/5-to-6
+++ b/src/migration-scripts/dhcp-server/5-to-6
@@ -14,6 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# T1968: allow multiple static-routes to be configured
+# T3838: rename dns-server -> name-server
import sys
from vyos.configtree import ConfigTree
@@ -45,6 +47,7 @@ for network in config.list_nodes(base):
for subnet in config.list_nodes(base_network + ['subnet']):
base_subnet = base_network + ['subnet', subnet]
+ # T1968: allow multiple static-routes to be configured
if config.exists(base_subnet + ['static-route']):
prefix = config.return_value(base_subnet + ['static-route', 'destination-subnet'])
router = config.return_value(base_subnet + ['static-route', 'router'])
@@ -53,6 +56,10 @@ for network in config.list_nodes(base):
config.set(base_subnet + ['static-route', prefix, 'next-hop'], value=router)
config.set_tag(base_subnet + ['static-route'])
+ # T3838: rename dns-server -> name-server
+ if config.exists(base_subnet + ['dns-server']):
+ config.rename(base_subnet + ['dns-server'], 'name-server')
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())