From 951f3833019411d514aac722a5ab87dbb0e9fc0c Mon Sep 17 00:00:00 2001 From: IK <cloud@cloud.bme.hu> Date: Sat, 25 Oct 2014 16:22:56 +0200 Subject: [PATCH] add missing ifdown line --- linux/network.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linux/network.py b/linux/network.py index 999847a..bc81cb7 100644 --- a/linux/network.py +++ b/linux/network.py @@ -40,6 +40,7 @@ def remove_interfaces_ubuntu(devices): if ifname in devices: # remove line delete_device = True + subprocess.call(('/sbin/ifdown', ifname)) subprocess.call(('/sbin/ip', 'addr', 'flush', 'dev', ifname)) subprocess.call(('/sbin/ip', 'link', 'set', 'dev', ifname, 'down')) @@ -89,6 +90,8 @@ def change_ip_ubuntu(interfaces, dns): 'prefixlen': prefixlen, 'gw': conf['gw6' if ip.version == 6 else 'gw4'], 'dns': dns}) + for ifname, conf in data: + subprocess.call(('/sbin/ifup', ifname)) # example: -- libgit2 0.26.0