summaryrefslogtreecommitdiff
path: root/src/migration-scripts/dhcp-server/5-to-6
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-09-18 21:48:53 +0200
committerChristian Poessinger <christian@poessinger.com>2021-09-19 12:23:39 +0200
commitabad387fcaf700a32f8fc85183d617fcfbb0b8f4 (patch)
treef4e04731c085c1a338bcff57a713d010168f96ab /src/migration-scripts/dhcp-server/5-to-6
parent482aaf1cee85487c14a183770d23ceda4611d1c6 (diff)
downloadvyos-1x-abad387fcaf700a32f8fc85183d617fcfbb0b8f4.tar.gz
vyos-1x-abad387fcaf700a32f8fc85183d617fcfbb0b8f4.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. (cherry picked from commit e2f9f4f4e8b2e961a58d935d09798ddb4e1e0460)
Diffstat (limited to 'src/migration-scripts/dhcp-server/5-to-6')
-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())