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
network-ng: drop fake interface #939
Conversation
* It fixes reading of unnamed interfaces (like s390 ones)
# | ||
# @return [Boolean] | ||
def present? | ||
!!type |
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.
is type really so deterministic? I though that type could be part of udev rule, not? What about dev_name?
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 would say that the type
is always there (but perhaps there is a better candidate) and, from udev, we are only able to infer the bus ID and the MAC. On the other hand, we want to avoid the dev_name because it might be missing (s390) and that's the main problem we try to address.
This method improves
Y2Network::Hwinfo
API adding a#netcards
method and implementing memoization. It does not have any performance impact because, at this time, the hardware info is stored inLanItems
anyway.Additionally, the hardware info is passed to
PhysicalInterface
through its constructor. It solves a problem where, although we had the hardware info for unnamed interfaces, thePhysicalInterface
was unable to find it because of the missing name.