Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1872,9 +1872,6 @@ def _remove_entry(table_name, key_name, config):
pre_running_config = duts_data[duthost.hostname]["pre_running_config"][cfg_context]
cur_running_config = duts_data[duthost.hostname]["cur_running_config"][cfg_context]

pre_running_config_keys = set(pre_running_config.keys())
cur_running_config_keys = set(cur_running_config.keys())

# Remove ignored keys from base config
for exclude_key in EXCLUDE_CONFIG_KEY_NAMES:
fields = exclude_key.split('|')
Expand All @@ -1883,17 +1880,20 @@ def _remove_entry(table_name, key_name, config):
_remove_entry(fields[0], fields[1], pre_running_config)
_remove_entry(fields[0], fields[1], cur_running_config)

pre_running_config_keys = set(pre_running_config.keys())
cur_running_config_keys = set(cur_running_config.keys())

# Check if there are extra keys in pre running config
pre_config_extra_keys = list(
pre_running_config_keys - cur_running_config_keys - EXCLUDE_CONFIG_TABLE_NAMES)
for key in pre_config_extra_keys:
pre_only_config[duthost.hostname].update({key: pre_running_config[key]})
pre_only_config[duthost.hostname][cfg_context].update({key: pre_running_config[key]})

# Check if there are extra keys in cur running config
cur_config_extra_keys = list(
cur_running_config_keys - pre_running_config_keys - EXCLUDE_CONFIG_TABLE_NAMES)
for key in cur_config_extra_keys:
cur_only_config[duthost.hostname].update({key: cur_running_config[key]})
cur_only_config[duthost.hostname][cfg_context].update({key: cur_running_config[key]})

# Get common keys in pre running config and cur running config
common_config_keys = list(pre_running_config_keys & cur_running_config_keys -
Expand Down