net: introduce find_candidate_nics()#1313
Merged
Merged
Conversation
cjp256
commented
Mar 1, 2022
| continue | ||
| driver = device_driver(interface) | ||
| if driver in blacklist_drivers: | ||
| LOG.debug( |
Contributor
Author
There was a problem hiding this comment.
I don't know if these debug logs are excessive, but I figured we may want to have some indication of why we are ignoring candidate NICs.
5cbc43e to
90b7ce6
Compare
find_fallback_nic_on_linux(), etc. provides valuable filtering of network interfaces in an effort to determine the best candidate for the fallback interface. Expose this logic with a new set of methods for finding the candidate network interfaces. These methods can be used by data sources which cannot rely on the fallback interface being the correct choice. Note that the MAC address filtering is now part of find_candidate_nics_on_linux(). This should be consistent behavior as find_fallback_nic_on_linux() never selected an interface without a MAC. find_fallback_nic_on_linux() continues to prefer eth0, but we make no such distinction in the candidate search. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
90b7ce6 to
dcf224e
Compare
Contributor
Author
|
@eb3095 This may be of interest to you? |
Contributor
Indeed, was hoping it was ready for the last PR, but left a note in a comment about switching out for it when it was available. This solves a few issues for us as well. |
anhvoms
approved these changes
Mar 3, 2022
|
|
||
| def find_fallback_nic(blacklist_drivers=None): | ||
| """Return the name of the 'fallback' network device.""" | ||
| def find_candidate_nics(blacklist_drivers: Optional[List] = None) -> List[str]: |
Contributor
There was a problem hiding this comment.
should these be Optional[List[str]]
Contributor
Author
There was a problem hiding this comment.
Good point fixed everywhere!
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
anhvoms
approved these changes
Mar 4, 2022
cae07aa to
1d84f8e
Compare
Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
TheRealFalcon
approved these changes
Mar 11, 2022
This was referenced May 12, 2023
Closed
This file contains hidden or 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
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.
find_fallback_nic_on_linux(), etc. provides valuable filtering of
network interfaces in an effort to determine the best candidate
for the fallback interface.
Expose this logic with a new set of methods for finding the candidate
network interfaces. These methods can be used by data sources which
cannot rely on the fallback interface being the correct choice.
Note that the MAC address filtering is now part of
find_candidate_nics_on_linux(). This should be consistent behavior
as find_fallback_nic_on_linux() never selected an interface without
a MAC. find_fallback_nic_on_linux() continues to prefer eth0,
but we make no such distinction in the candidate search.
Signed-off-by: Chris Patterson cpatterson@microsoft.com