summaryrefslogtreecommitdiff
path: root/src/conf_mode/interface-wireguard.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-09-24 22:15:22 +0200
committerChristian Poessinger <christian@poessinger.com>2019-09-24 22:15:22 +0200
commitfc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034 (patch)
treeb6c2a3a124441ab0d3d3a216638c803979cd1505 /src/conf_mode/interface-wireguard.py
parenta7908d8340072d353e3bd75626a209f45e037989 (diff)
parentfe8cd98c92b5f51fecace373ad18f8dfa3727f8b (diff)
downloadvyos-1x-fc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034.tar.gz
vyos-1x-fc5e0d7ee59c6ca35c7cb53bb6ed9bcbdfb73034.zip
Merge branch 'current' of github.com:vyos/vyos-1x into equuleus
* 'current' of github.com:vyos/vyos-1x: (31 commits) Jenkins: rely on the global defined label for Docker executors Python/ifconfig: T1557: add STPIf class (spanning tree) bridge member Python/ifconfig: T1557: bugfix removing Q-in-Q VLAN interfaces openvpn: T1548: setup interface alias Python/ifconfig: T1557: refactor BondIf 'mode' property to set_mode() Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval() Python/ifconfig: T1557: refactor BondIf 'arp_ip_target' property to set_arp_ip_target()/get_arp_ip_target() Python/ifconfig: T1557: refactor BondIf 'arp_interval' property to set_arp_interval() Python/ifconfig: T1557: refactor BondIf 'xmit_hash_policy' property to set_hash_policy() Python/ifconfig: T1557: remove unused has_autoneg() from EthernetIf Python/ifconfig: T1557: refactor Interface 'state' property to set_state()/get_state() Python/ifconfig: T1557: refactor Interface 'arp_cache_tmo' property to set_set_arp_cache_tmo() Python/ifconfig: T1557: refactor Interface 'proxy_arp_pvlan' property to set_proxy_arp_pvlan() Python/ifconfig: T1557: refactor Interface 'proxy_arp' property to set_proxy_arp() Python/ifconfig: T1557: loopback: implement derived remove() Python/ifconfig: T1557: refactor Interface 'ifalias' property to set_alias() Python/ifconfig: T1557: refactor Interface 'link_detect' property to set_link_detect() Python/ifconfig: T1557: refactor BridgeIf 'stp_state' property to set_stp() Python/ifconfig: T1557: refactor BridgeIf 'priority' property to set_priority() Python/ifconfig: T1557: refactor BridgeIf 'ageing_time' property to set_ageing_time() ...
Diffstat (limited to 'src/conf_mode/interface-wireguard.py')
-rwxr-xr-xsrc/conf_mode/interface-wireguard.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/conf_mode/interface-wireguard.py b/src/conf_mode/interface-wireguard.py
index 4ae3251fe..3fd29ad4d 100755
--- a/src/conf_mode/interface-wireguard.py
+++ b/src/conf_mode/interface-wireguard.py
@@ -13,8 +13,6 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#
import sys
import os
@@ -97,7 +95,7 @@ def get_config():
if c.exists(ifname + ' mtu'):
config_data[ifname]['mtu'] = c.return_value(ifname + ' mtu')
if c.exists(ifname + ' private-key'):
- config_data[ifname]['pk'] = "{0}/{1}/private.key".format(kdir,c.return_value(ifname + ' private-key'))
+ config_data[ifname]['pk'] = "{0}/{1}/private.key".format(kdir,c.return_value(ifname + ' private-key'))
if c.exists(ifname + ' peer'):
for p in c.list_nodes(ifname + ' peer'):
if not c.exists(ifname + ' peer ' + p + ' disable'):
@@ -175,11 +173,11 @@ def apply(c):
# interface state
if c[ifname]['state'] == 'disable':
sl.syslog(sl.LOG_NOTICE, "disable interface " + ifname)
- intfc.state = 'down'
+ intfc.set_state('down')
else:
- if not intfc.state == 'up':
+ if not intfc.get_state() == 'up':
sl.syslog(sl.LOG_NOTICE, "enable interface " + ifname)
- intfc.state = 'up'
+ intfc.set_state('up')
# IP address
if not c_eff.exists_effective(ifname + ' address'):
@@ -204,15 +202,15 @@ def apply(c):
# interface MTU
if c[ifname]['mtu'] != 1420:
- intfc.mtu = int(c[ifname]['mtu'])
+ intfc.set_mtu(int(c[ifname]['mtu']))
else:
# default is set to 1420 in config_data
- intfc.mtu = int(c[ifname]['mtu'])
+ intfc.set_mtu(int(c[ifname]['mtu']))
# ifalias for snmp from description
descr_eff = c_eff.return_effective_value(ifname + ' description')
if descr_eff != c[ifname]['descr']:
- intfc.ifalias = str(c[ifname]['descr'])
+ intfc.set_alias(str(c[ifname]['descr']))
# peer deletion
peer_eff = c_eff.list_effective_nodes(ifname + ' peer')