This commit is contained in:
Ad Schellevis
2023-08-08 18:20:39 +02:00
parent 94fcdedf5f
commit 1490e00a69
2 changed files with 8 additions and 17 deletions
@@ -1,6 +1,6 @@
<model>
<mount>//OPNsense/Tinc</mount>
<version>1.0.3</version>
<version>1.0.4</version>
<description>
OPNsense Tinc VPN
</description>
@@ -60,10 +60,10 @@
<MaximumValue>65535</MaximumValue>
<ValidationMessage>Ping timeout must be between 1...65535</ValidationMessage>
</pingtimeout>
<StrictSubnets type="BooleanField">
<default>0</default>
<Required>N</Required>
</StrictSubnets>
<StrictSubnets type="BooleanField">
<default>0</default>
<Required>Y</Required>
</StrictSubnets>
<privkey type="TextField">
<Required>Y</Required>
</privkey>
@@ -82,10 +82,7 @@ class Network(NetwConfObject):
return self._payload['mode']
def get_debuglevel(self):
if len(self._payload['debuglevel']) > 1:
return self._payload['debuglevel'][1]
else:
return '0'
return self._payload['debuglevel'][1] if len(self._payload['debuglevel']) > 1 else '0'
def set_hosts(self, hosts):
for host in hosts:
@@ -95,16 +92,10 @@ class Network(NetwConfObject):
self._hosts.append(hostObj)
def set_PMTUDiscovery(self, value):
if value.text != '1':
self._payload['PMTUDiscovery'] = 'no'
else:
self._payload['PMTUDiscovery'] = 'yes'
self._payload['PMTUDiscovery'] = 'no' if value.text != '1' else 'yes'
def set_StrictSubnets(self, value):
if value.text != '1':
self._payload['StrictSubnets'] = 'no'
else:
self._payload['StrictSubnets'] = 'yes'
self._payload['StrictSubnets'] = 'no' if value.text != '1' else 'yes'
def config_text(self):
result = list()