summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-01-26 23:10:00 +0100
committerDaniil Baturin <daniil@baturin.org>2019-01-26 23:10:00 +0100
commit97186852f529935309c009e38403cead2bf0ce75 (patch)
treec5a15278e8b7c70b41223538ece8e326146179e2 /src/conf_mode
parent962f880554e70afc94f8902bb3742a8c0ef44fca (diff)
parent6d172d767360a675462da6a0bac100a24c544892 (diff)
downloadvyos-1x-97186852f529935309c009e38403cead2bf0ce75.tar.gz
vyos-1x-97186852f529935309c009e38403cead2bf0ce75.zip
Merge branch 'current' into crux
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/task_scheduler.py2
-rwxr-xr-xsrc/conf_mode/wireguard.py14
2 files changed, 8 insertions, 8 deletions
diff --git a/src/conf_mode/task_scheduler.py b/src/conf_mode/task_scheduler.py
index 285afe2b5..b171e9576 100755
--- a/src/conf_mode/task_scheduler.py
+++ b/src/conf_mode/task_scheduler.py
@@ -49,7 +49,7 @@ def make_command(executable, arguments):
if arguments:
return("sg vyattacfg \"{0} {1}\"".format(executable, arguments))
else:
- return(executable)
+ return("sg vyattacfg \"{0}\"".format(executable))
def get_config():
conf = Config()
diff --git a/src/conf_mode/wireguard.py b/src/conf_mode/wireguard.py
index f5452579e..c88e9085a 100755
--- a/src/conf_mode/wireguard.py
+++ b/src/conf_mode/wireguard.py
@@ -124,7 +124,6 @@ def get_config():
if c.exists(cnf + ' peer ' + p + ' preshared-key'):
config_data['interfaces'][intfc]['peer'][p]['psk'] = c.return_value(cnf + ' peer ' + p + ' preshared-key')
-
return config_data
def verify(c):
@@ -166,12 +165,13 @@ def apply(c):
### link status up/down aka interface disable
for intf in c['interfaces']:
- if c['interfaces'][intf]['state'] == 'disable':
- sl.syslog(sl.LOG_NOTICE, "disable interface " + intf)
- subprocess.call(['ip l s dev ' + intf + ' down ' + ' &>/dev/null'], shell=True)
- else:
- sl.syslog(sl.LOG_NOTICE, "enable interface " + intf)
- subprocess.call(['ip l s dev ' + intf + ' up ' + ' &>/dev/null'], shell=True)
+ if not c['interfaces'][intf]['status'] == 'delete':
+ if c['interfaces'][intf]['state'] == 'disable':
+ sl.syslog(sl.LOG_NOTICE, "disable interface " + intf)
+ subprocess.call(['ip l s dev ' + intf + ' down ' + ' &>/dev/null'], shell=True)
+ else:
+ sl.syslog(sl.LOG_NOTICE, "enable interface " + intf)
+ subprocess.call(['ip l s dev ' + intf + ' up ' + ' &>/dev/null'], shell=True)
### deletion of a specific interface
for intf in c['interfaces']: