Skip to content
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
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Jun 16, 2023

  1. Methods to handle interfaces selection like ifupdown1

    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.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    40c2049 View commit details
    Browse the repository at this point in the history
  2. Early expand for the ifacenames variable

    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.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    18af407 View commit details
    Browse the repository at this point in the history
  3. Parsing integration for all ifupdown2 operations

    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.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    d426c77 View commit details
    Browse the repository at this point in the history
  4. New behavior for _get_filtered_ifacenames_with_classes

    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.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    c4ee00b View commit details
    Browse the repository at this point in the history
  5. Implement new interfaces selection for ifquery

    * The 'no ifaces found matching' exception has been replaced by a quiet early return
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    bc8f70a View commit details
    Browse the repository at this point in the history
  6. Implement new interfaces selection for ifdown

    * The 'no ifaces found matching' exception has been replaced by a quiet early return
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    dc716bf View commit details
    Browse the repository at this point in the history
  7. Implement new interfaces selection for ifup

    * The 'no ifaces found matching' exception has been replaced by a quiet early return
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    647443d View commit details
    Browse the repository at this point in the history
  8. Implement new interfaces selection for ifreload

    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.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    7822e66 View commit details
    Browse the repository at this point in the history
  9. Update man for all commands

    ifupdown1 and ifupdown2 man are missleading on the -a/--all option.
    Olivier BLIN committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    bff9eab View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. Add support to call ifupdown on all interfaces

    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.
    Olivier BLIN committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    1e4e089 View commit details
    Browse the repository at this point in the history
  2. Update man for --allow-all flag

    Olivier BLIN committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    d1ad0bc View commit details
    Browse the repository at this point in the history