diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-19 21:20:33 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-19 21:20:35 +0200 |
commit | df1096e271e0e110bf3a39ffda4785f2e8a0e23f (patch) | |
tree | 463685c7da41432d2dacbd3ae7b927854d797105 /src/conf_mode/interfaces-pseudo-ethernet.py | |
parent | e3fdb3c4f2b2b94e241ecd82dcb032020bbc1718 (diff) | |
download | vyos-1x-df1096e271e0e110bf3a39ffda4785f2e8a0e23f.tar.gz vyos-1x-df1096e271e0e110bf3a39ffda4785f2e8a0e23f.zip |
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.
Diffstat (limited to 'src/conf_mode/interfaces-pseudo-ethernet.py')
-rwxr-xr-x | src/conf_mode/interfaces-pseudo-ethernet.py | 9 |
1 files changed, 5 insertions, 4 deletions
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 |