summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py11
-rwxr-xr-xsrc/conf_mode/vpn_l2tp.py3
-rwxr-xr-xsrc/conf_mode/vpn_pptp.py3
3 files changed, 13 insertions, 4 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 1978adff5..957f72ed5 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -33,7 +33,7 @@ def get_config():
base = ['protocols', 'nbgp']
bgp = conf.get_config_dict(base, key_mangling=('-', '_'))
if not conf.exists(base):
- return None
+ bgp = {}
from pprint import pprint
pprint(bgp)
@@ -44,10 +44,16 @@ def verify(bgp):
if not bgp:
return None
+ # Check if declared more than one ASN
+ for asn in bgp['nbgp'].items():
+ if len(bgp['nbgp']) > 1:
+ raise ConfigError('Only one bgp ASN process can be definded')
+
return None
def generate(bgp):
if not bgp:
+ bgp['new_frr_config'] = ''
return None
# render(config) not needed, its only for debug
@@ -58,9 +64,6 @@ def generate(bgp):
return None
def apply(bgp):
- if bgp is None:
- return None
-
# Save original configration prior to starting any commit actions
bgp['original_config'] = frr.get_configuration(daemon='bgpd')
bgp['modified_config'] = frr.replace_section(bgp['original_config'], bgp['new_frr_config'], from_re='router bgp .*')
diff --git a/src/conf_mode/vpn_l2tp.py b/src/conf_mode/vpn_l2tp.py
index 48d887abe..465986d5b 100755
--- a/src/conf_mode/vpn_l2tp.py
+++ b/src/conf_mode/vpn_l2tp.py
@@ -162,6 +162,9 @@ def get_config(config=None):
conf.set_level(base_path + ['authentication', 'radius', 'server', server])
+ if conf.exists(['disable-accounting']):
+ radius['acct_port'] = '0'
+
if conf.exists(['fail-time']):
radius['fail_time'] = conf.return_value(['fail-time'])
diff --git a/src/conf_mode/vpn_pptp.py b/src/conf_mode/vpn_pptp.py
index 306d05c60..3125ee9d0 100755
--- a/src/conf_mode/vpn_pptp.py
+++ b/src/conf_mode/vpn_pptp.py
@@ -121,6 +121,9 @@ def get_config(config=None):
conf.set_level(base_path + ['authentication', 'radius', 'server', server])
+ if conf.exists(['disable-accounting']):
+ radius['acct_port'] = '0'
+
if conf.exists(['fail-time']):
radius['fail_time'] = conf.return_value(['fail-time'])