From c26fb9bc15bd625b11ae1674bddf8daf168b0f76 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 4 Mar 2020 19:12:18 +0100 Subject: vrf: T31: no need to use sudo calls in vrf.py All configuration mode scripts are already run with sudo. --- src/conf_mode/vrf.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 9896c7c85..4dddc7de9 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -152,18 +152,18 @@ def apply(command): # RTNETLINK answers: Operation not supported # so require to remove vrf and change all existing the interfaces - if os.system(f'sudo ip link delete dev {name}'): + if os.system(f'ip link delete dev {name}'): continue action = 'add' if action == 'add': commands = [ - f'sudo ip link add {name} type vrf table {table}', - f'sudo ip link set dev {name} up', - f'sudo ip -4 rule add oif {name} lookup {table}', - f'sudo ip -4 rule add iif {name} lookup {table}', - f'sudo ip -6 rule add oif {name} lookup {table}', - f'sudo ip -6 rule add iif {name} lookup {table}', + f'ip link add {name} type vrf table {table}', + f'ip link set dev {name} up', + f'ip -4 rule add oif {name} lookup {table}', + f'ip -4 rule add iif {name} lookup {table}', + f'ip -6 rule add oif {name} lookup {table}', + f'ip -6 rule add iif {name} lookup {table}', ] for command in commands: -- cgit v1.2.3