Skip to content

Commit

Permalink
conntrack: T5376: Fixes for conntrack-sync configdep
Browse files Browse the repository at this point in the history
Fixes `KeyError: 'conntrack_sync'`
Ignore `ConfigError("ConfigError('Interface eth1 requires an IP address!')")` due to calling conntrack-sync too early
  • Loading branch information
sarthurdev committed Sep 29, 2023
1 parent 400df97 commit 42ff4d8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
21 changes: 17 additions & 4 deletions data/config-mode-dependencies/vyos-1x.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
{
"conntrack": {"conntrack_sync": ["conntrack_sync"]},
"firewall": {"conntrack": ["conntrack"], "group_resync": ["conntrack", "nat", "policy-route"]},
"firewall": {
"conntrack": ["conntrack"],
"conntrack_sync": ["conntrack_sync"],
"group_resync": ["conntrack", "nat", "policy-route"]
},
"http_api": {"https": ["https"]},
"load_balancing_wan": {"conntrack": ["conntrack"]},
"nat": {"conntrack": ["conntrack"]},
"nat66": {"conntrack": ["conntrack"]},
"load_balancing_wan": {
"conntrack": ["conntrack"],
"conntrack_sync": ["conntrack_sync"]
},
"nat": {
"conntrack": ["conntrack"],
"conntrack_sync": ["conntrack_sync"]
},
"nat66": {
"conntrack": ["conntrack"],
"conntrack_sync": ["conntrack_sync"]
},
"pki": {
"ethernet": ["interfaces-ethernet"],
"openvpn": ["interfaces-openvpn"],
Expand Down
7 changes: 6 additions & 1 deletion src/conf_mode/conntrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ def apply(conntrack):
module_str = ' '.join(rm_modules)
cmd(f'rmmod {module_str}')

call_dependents()
try:
call_dependents()
except ConfigError:
# Ignore config errors on dependent due to being called too early. Example:
# ConfigError("ConfigError('Interface ethN requires an IP address!')")
pass

# We silently ignore all errors
# See: https://bugzilla.redhat.com/show_bug.cgi?id=1264080
Expand Down

0 comments on commit 42ff4d8

Please sign in to comment.