-
Notifications
You must be signed in to change notification settings - Fork 76
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
Implement interfaces selection like ifupdown1 #265
Open
OlivierB
wants to merge
11
commits into
CumulusNetworks:master
Choose a base branch
from
Alphalink:auto_allow_iflist_rework
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Implement interfaces selection like ifupdown1 #265
OlivierB
wants to merge
11
commits into
CumulusNetworks:master
from
Alphalink:auto_allow_iflist_rework
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifupdown2 does not exactly respect ifupdown1 interfaces selection. It is a bit messed up between auto/all/allow/IFLIST. In ifupdown1, you must provide a -a/--all or IFLIST (except for query -l command). The --allow CLASSes are used for filtering interfaces to modify. The -a/--all command set an 'auto' CLASS if no allowed CLASS are provided. `ifup -a` command, UP all interfaces with the auto CLASS. `ifup eth1` command, UP eth1 interface (no CLASS filtering). `ifup -a --allow special`, only UP interfaces with the special CLASS. `ifup --allow hotplug eth4`, only UP eth4 interface if it has the hotplug CLASS. For query command, the -a/--all is implicit. In ifupdown2, the --allow CLASS is used as a way to retrieve interfaces. ifup/ifdown neither `--allow hotplug eth4` nor `-a --allow special` work. ifquery command returns duplicate interfaces in output.
This variable is passed to multiple functions where interfaces are expanded if a specific pattern is given. Sometimes, functions forget to do the expand and fail to give a result... Remaining expand in the code can be removed later without impact.
Use the new methods to create a standard interface selection for ifup, ifdown, ifquery and ifreload operations. ifquery and ifreload have a tricky implicit configuration, but I have tried to not modify the ifupdown2 behavior in any way. There is one changement on the -a/--all option that can be present or not when implicit. Now, the `ifreload -a -c` command works for example.
Manage the IFLIST or -a/--all input for selection. Early call of _preprocess_ifacenames to control interfaces. Use --allow CLASS as a filter and not as an interfaces selector.
OlivierB
force-pushed
the
auto_allow_iflist_rework
branch
from
June 16, 2023 08:33
fe811d2
to
0fe1df0
Compare
* The 'no ifaces found matching' exception has been replaced by a quiet early return
* The 'no ifaces found matching' exception has been replaced by a quiet early return
* The 'no ifaces found matching' exception has been replaced by a quiet early return
Reload operation uses a -a/--all option without --allow auto as default. This command has an impact on ALL interfaces by default. The --allow can be set to filter the targetted interfaces. I do not really understand why the IFLIST is disable on this operation. It could be very useful.
OlivierB
force-pushed
the
auto_allow_iflist_rework
branch
from
June 16, 2023 09:03
0fe1df0
to
7822e66
Compare
ifupdown1 and ifupdown2 man are missleading on the -a/--all option.
For ifupdown compatibility, '--all' implies '--allow auto'. '--allow-all' parameter offers a way to have all interfaces without implicit filter. On ifquery, --all is implicit when no interfaces are provided. So 'ifquery --allow-all' shows information on all interfaces.
OlivierB
force-pushed
the
auto_allow_iflist_rework
branch
from
January 10, 2024 15:28
a4bee3b
to
1e4e089
Compare
My last commit adds support to request information on all interfaces (even if auto is not set):
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request (PR) is the third part of the changes originating from #235.
This PR requires the
Makes "auto" an alias for "allow-auto"
functionality from part 1 #263 to work without regressions.Futhermore, these modifications will allow us to simplify ifup/ifdown calls in hotplug PR (Part 2: #264). ifquery call will be useless.