-
Notifications
You must be signed in to change notification settings - Fork 993
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 #38046 - Make sure IPv6 interface can be primary #10389
base: develop
Are you sure you want to change the base?
Conversation
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.
Interesting you hit this code. Facter has networking.primary
but I suspect you're using another fact provider.
2246b76
to
78879a3
Compare
I didn't try a real-life scenario. This was one of the places that had a reference only to IPv4, but not to IPv6. I didn't try to change the logic more than is needed. While I am at it, changed the implementation to resolve both IPv4 and IPv6 separately. |
78879a3
to
52ebe09
Compare
52ebe09
to
c2cccfd
Compare
Now it should look a bit more reasonable. Also fixed the tests to use the testing range. |
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 think the separate try_resolve
method is a good refactor.
'br0' => {'ipaddress6' => '2001:db8::10', 'macaddress' => '00:00:00:00:00:10'}, | ||
'em1' => {'ipaddress6' => '2001:db8::20', 'macaddress' => '00:00:00:00:00:20'}, | ||
'em2' => {'ipaddress6' => '2001:db8::30', 'macaddress' => '00:00:00:00:00:30'}, | ||
'bond0' => {'ipaddress6' => '2001:db8::40', 'macaddress' => '00:00:00:00:00:40'}, | ||
}.with_indifferent_access) |
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'd prefer to be stricter and provide just a regular hash with the right types. Though you are right that it's presented as indifferent access
'br0' => {'ipaddress6' => '2001:db8::10', 'macaddress' => '00:00:00:00:00:10'}, | |
'em1' => {'ipaddress6' => '2001:db8::20', 'macaddress' => '00:00:00:00:00:20'}, | |
'em2' => {'ipaddress6' => '2001:db8::30', 'macaddress' => '00:00:00:00:00:30'}, | |
'bond0' => {'ipaddress6' => '2001:db8::40', 'macaddress' => '00:00:00:00:00:40'}, | |
}.with_indifferent_access) | |
'br0' => {ipaddress6: '2001:db8::10', macaddress: '00:00:00:00:00:10'}, | |
'em1' => {ipaddress6: '2001:db8::20', macaddress: '00:00:00:00:00:20'}, | |
'em2' => {ipaddress6: '2001:db8::30', macaddress: '00:00:00:00:00:30'}, | |
'bond0' => {ipaddress6: '2001:db8::40', macaddress: '00:00:00:00:00:40'}, | |
}) |
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 prefer having the style consistent with the rest of the file. So unless you feel it's really wrong, I think we should leave it with the indifferent access.
No description provided.