-
Notifications
You must be signed in to change notification settings - Fork 989
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
Fixes #36548 - Avoid parsing interfaces with shared MACs #9761
base: develop
Are you sure you want to change the base?
Fixes #36548 - Avoid parsing interfaces with shared MACs #9761
Conversation
Issues: #36548 |
6b3ad95
to
14149f2
Compare
@nofaralfasi would you mind reviewing this? |
14149f2
to
f04eb9c
Compare
The tests are failing because in |
While going over the original bug I realized that the issue wasn't the duplicate MAC but the duplicate interface names. I'll rewrite the PR. |
This is the same implementation as the parent class and simple inheritance should achieve the same thing.
I needed to understand what these methods were doing and the data types. This helped me and hopefully it helps future readers.
In Azure it is possible to see the same interface share the same MAC address. Foreman wants to identify an interface by its MAC address, and doesn't handle it. This patch makes `parse_interfaces?` take duplicate MAC addresses into account and ignores them. While it's not pretty, it at least allows other facts to be imported.
I've done some further analysis and I believe my initial impression that the duplicate mac was the problem was correct. Just where it went wrong. I now thing this is the problem: foreman/app/models/host/base.rb Lines 195 to 200 in 6aac916
We can see in the actual code there's matching by mac address: foreman/app/models/host/base.rb Lines 455 to 481 in 6aac916
That is not correct. |
f04eb9c
to
47639d6
Compare
I pushed some commits that separate it out. @nofaralfasi had a question about the chef fact parser and that's now a separate commit. There's also one that improves docs because I had to understand what was going on. |
In Azure it is possible to see the same interface share the same MAC address. Foreman wants to identify an interface by its MAC address, and doesn't handle it.
This patch makes
parse_interfaces?
take duplicate MAC addresses into account and ignores them. While it's not pretty, it at least allows other facts to be imported.At the moment it's completely untested, but allows me to share the concept easier then describing it.