summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-10-03 20:36:18 +0200
committerChristian Poessinger <christian@poessinger.com>2020-10-03 20:36:18 +0200
commit585aaf9c5770e2a0784849aee75213bd4ea1871a (patch)
tree476c918d2ec10eb12022a6a2432361c6b17a09b3
parentc79f9144a6bac9b1dbdffcd6a02762a6adeabcfa (diff)
downloadvyos-1x-585aaf9c5770e2a0784849aee75213bd4ea1871a.tar.gz
vyos-1x-585aaf9c5770e2a0784849aee75213bd4ea1871a.zip
sstp: T2953: migrate mtu to common level
Preparation before using get_config_dict() and common Jinja2 templates.
-rw-r--r--interface-definitions/vpn_sstp.xml.in2
-rwxr-xr-xsrc/conf_mode/vpn_sstp.py1
-rwxr-xr-xsrc/migration-scripts/sstp/2-to-35
3 files changed, 6 insertions, 2 deletions
diff --git a/interface-definitions/vpn_sstp.xml.in b/interface-definitions/vpn_sstp.xml.in
index 3d28878bc..5ef503041 100644
--- a/interface-definitions/vpn_sstp.xml.in
+++ b/interface-definitions/vpn_sstp.xml.in
@@ -25,6 +25,7 @@
</node>
</children>
</node>
+ #include <include/interface-mtu-68-1500.xml.i>
#include <include/accel-name-server.xml.i>
<node name="network-settings">
<properties>
@@ -41,7 +42,6 @@
</children>
</node>
#include <include/accel-client-ipv6-pool.xml.i>
- #include <include/interface-mtu-68-1500.xml.i>
</children>
</node>
<node name="ppp-options">
diff --git a/src/conf_mode/vpn_sstp.py b/src/conf_mode/vpn_sstp.py
index a4a17de9c..15fcfcef3 100755
--- a/src/conf_mode/vpn_sstp.py
+++ b/src/conf_mode/vpn_sstp.py
@@ -270,7 +270,6 @@ def get_config(config=None):
#
# read in network settings
- conf.set_level(base_path + ['network-settings'])
if conf.exists(['mtu']):
sstp['mtu'] = conf.return_value(['mtu'])
diff --git a/src/migration-scripts/sstp/2-to-3 b/src/migration-scripts/sstp/2-to-3
index db705f5eb..dc96a2d30 100755
--- a/src/migration-scripts/sstp/2-to-3
+++ b/src/migration-scripts/sstp/2-to-3
@@ -44,6 +44,11 @@ else:
config.copy(config_ns, base_path + ['name-server'])
config.delete(config_ns)
+ config_mtu = base_path + ['network-settings', 'mtu']
+ if config.exists(config_mtu):
+ config.copy(config_mtu, base_path + ['mtu'])
+ config.delete(config_mtu)
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())