-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nat64: T6627: call check_kmod within standard config function #3927
Conversation
👍 |
❌ |
src/conf_mode/nat64.py
Outdated
if not nat64: | ||
# no need to verify the CLI as nat64 is going to be deactivated | ||
unload_kmod(['jool']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm quite uneasy about system state changes in verify()
. I'm inclined to think that verify()
should never include any logic except config verification. Do you think it's feasible to move this to apply()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed: though I consider the real problem with the logic of this script to be the need to modprobe in the verify()
stage, no need to make it worse. Moved to apply()
.
Functions called from config scripts outside of the standard functions get_config/verify/generate/apply will not be called when run under configd. Move as appropriate for the general config script structure and the specific script requirements.
cb05004
to
aeb5197
Compare
@Mergifyio backport circinus |
✅ Backports have been created
|
Change Summary
The config mode script nat64.py calls the modprobe utility
check_kmod
outside of the standard functions, leading to anOSError
when run under configd. Current behavior of configd will re-run the script within the CLI context, leading to config and smoketest success; as that behavior will be changed in the future to accommodate all scripts running within the configd context (T6608), correct now.There are several other config scripts that use this pattern, which will be all changed in a separate PR. The nat64.py script deserved special attention as it provides an example of state configuration informing the syntax verification stage, which should be kept in mind as we move to distinguishing syntax verification from system state verification.
Types of changes
Related Task(s)
Related PR(s)
Component(s) name
Proposed changes
How to test
Confirmation provided in task. Success in smoketest and journalctl output, below.
Smoketest result
Checklist: