diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/vyos/configdict.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 58ecd3f17..660d779d4 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -290,8 +290,12 @@ def get_interface_dict(config, base, ifname=''): config.set_level(base + [ifname]) dict = config.get_config_dict([], key_mangling=('-', '_'), get_first_key=True) - # Check if interface has been removed - if dict == {}: + # Check if interface has been removed. We must use exists() as get_config_dict() + # will always return {} - even when an empty interface node like + # +macsec macsec1 { + # +} + # exists. + if not config.exists([]): dict.update({'deleted' : ''}) # Add interface instance name into dictionary |