From 2ad8fa385cefa1acbe75b8ca22a4183b00edf7de Mon Sep 17 00:00:00 2001 From: hagbard Date: Fri, 2 Nov 2018 12:15:34 -0700 Subject: T949: config issue when creating multiple wg interfaces at the same time. --- src/conf_mode/wireguard.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/conf_mode/wireguard.py b/src/conf_mode/wireguard.py index c6440ad81..3c8ade1db 100755 --- a/src/conf_mode/wireguard.py +++ b/src/conf_mode/wireguard.py @@ -295,18 +295,13 @@ def configure_interface(c, intf): os.remove(psk_file) def add_addr(intf, addr): + # see https://phabricator.vyos.net/T949 ret = subprocess.call(['ip a a dev ' + intf + ' ' + addr + ' &>/dev/null'], shell=True) - if ret != 0: - raise ConfigError('Can\'t set IP ' + addr + ' on ' + intf) - else: - sl.syslog(sl.LOG_NOTICE, "ip a a dev " + intf + " " + addr) + sl.syslog(sl.LOG_NOTICE, "ip a a dev " + intf + " " + addr) def del_addr(intf, addr): ret = subprocess.call(['ip a d dev ' + intf + ' ' + addr + ' &>/dev/null'], shell=True) - if ret != 0: - raise ConfigError('Can\'t delete IP ' + addr + ' on ' + intf) - else: - sl.syslog(sl.LOG_NOTICE, "ip a d dev " + intf + " " + addr) + sl.syslog(sl.LOG_NOTICE, "ip a d dev " + intf + " " + addr) if __name__ == '__main__': try: -- cgit v1.2.3