From df1096e271e0e110bf3a39ffda4785f2e8a0e23f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 19 Jun 2020 21:20:33 +0200 Subject: pseudo-ethernet: T2589: fix for deleting interface(s) When deleting a peth interface the interface name was not added to the configuration dict, which lead to referencing non existent keys. --- src/conf_mode/interfaces-pseudo-ethernet.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/conf_mode/interfaces-pseudo-ethernet.py') diff --git a/src/conf_mode/interfaces-pseudo-ethernet.py b/src/conf_mode/interfaces-pseudo-ethernet.py index b142688f6..70710e97c 100755 --- a/src/conf_mode/interfaces-pseudo-ethernet.py +++ b/src/conf_mode/interfaces-pseudo-ethernet.py @@ -46,17 +46,18 @@ default_config_data = { } def get_config(): + peth = deepcopy(default_config_data) + conf = Config() + # determine tagNode instance if 'VYOS_TAGNODE_VALUE' not in os.environ: raise ConfigError('Interface (VYOS_TAGNODE_VALUE) not specified') - ifname = os.environ['VYOS_TAGNODE_VALUE'] - conf = Config() + peth['intf'] = os.environ['VYOS_TAGNODE_VALUE'] # Check if interface has been removed - cfg_base = ['interfaces', 'pseudo-ethernet', ifname] + cfg_base = ['interfaces', 'pseudo-ethernet', peth['intf']] if not conf.exists(cfg_base): - peth = deepcopy(default_config_data) peth['deleted'] = True return peth -- cgit v1.2.3