summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/conf_mode/vpp_interfaces_bonding.py23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/conf_mode/vpp_interfaces_bonding.py b/src/conf_mode/vpp_interfaces_bonding.py
index 9f8133cfa..e1919e946 100644
--- a/src/conf_mode/vpp_interfaces_bonding.py
+++ b/src/conf_mode/vpp_interfaces_bonding.py
@@ -88,19 +88,18 @@ def get_config(config=None) -> dict:
)
# Get effective config as we need full dicitonary per interface delete
- if __name__ == '__main__':
- effective_config = conf.get_config_dict(
- base + [ifname],
- key_mangling=('-', '_'),
- effective=True,
- get_first_key=True,
- no_tag_node_value_mangle=True,
- )
- # if a file was started as dependency, we are starting from empty config
- else:
- effective_config = {}
+ effective_config = conf.get_config_dict(
+ base + [ifname],
+ key_mangling=('-', '_'),
+ effective=True,
+ get_first_key=True,
+ no_tag_node_value_mangle=True,
+ )
+
+ if effective_config:
+ config.update({'effective': effective_config})
- if not config:
+ if not conf.exists(base + [ifname]):
config['remove'] = True
if effective_config: