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

cli: drop python-netifaces (LP: #2065870, LP: #2017585) #503

Merged
merged 3 commits into from
Aug 28, 2024

Commits on Aug 23, 2024

  1. cli: drop python-netifaces

    netifaces doesn't return the permanent MAC address of physical
    interfaces. This is causing issues when we try to find interfaces that
    are matched by MAC address but their MACs changed (because they were
    added to a bond for example).
    
    We only use it to retrieve the list of interfaces and their MACs so
    let's drop it and implement this functionalities in the CLI.
    
    get_interfaces() will simply call "ip link" and return a list with the
    interface names.
    
    get_interface_macaddress() will try to get the permanent MAC address and
    fallback to the transient address if it can't be found.
    daniloegea committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    6b4c79b View commit details
    Browse the repository at this point in the history
  2. apply: don't skip members of bonds on renaming

    Skipping members of bonds when searching for interfaces that need to
    be renamed was done as a workaround for LP: #1802322.
    
    The actual problem was that members of bonds will have their MAC
    addresses changed to a common address when they are added as members.
    The renaming process looked for interfaces based on their transient MAC
    addresses not the permanent one. Because of that, it would confuse one
    interface by another and try to rename it.
    
    The process was changed to look for the permanent MAC address so this
    problem shouldn't happen. It also searches only for physical interfaces,
    which should have a permanent MAC address.
    
    Skipping the renaming of members of bonds will cause the backend to
    "forget" about it. Once the configuration is generated with a different
    name, the backend will look for the new name. As the interface will
    continue to have the previous name, it will not be managed anymore.
    
    Lets fix this by allowing the renaming these interfaces. If the system
    administrator changed the "set-name" setting, they probably want to get
    the interface renamed. This might cause a quick loss of connectivity on
    the interface being renamed.
    
    Drop is_composite_member(). This method is not needed anymore.
    daniloegea committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    3e31729 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6bcae2f View commit details
    Browse the repository at this point in the history