-
Notifications
You must be signed in to change notification settings - Fork 28
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
Don't depend on eth0 for displaying network information #263
Don't depend on eth0 for displaying network information #263
Conversation
When displaying the current network information iterate over all network interfaces not just eth0
I thought this would help put some of the changes to LinuxAdmin in context of how they might be used |
@@ -10,7 +10,7 @@ def initialize | |||
self.database_name = "vmdb_production" | |||
self.database_user = "root" | |||
self.database_password = nil | |||
self.primary_host = LinuxAdmin::NetworkInterface.new(NETWORK_INTERFACE).address | |||
self.primary_host = network_interfaces.first&.address |
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.
NOTE this will only work reliably with a single non-loopback interface, but this is just the default presented to the user and they can enter any address that they want plus our appliances only ship by default with a single NIC.
In the future I think a #default?
attribute or something like that which checks which dev is used for the default route would let us pick the interface most likely to be the "right one" ™️
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 that's fine. There was no guarantee before that eth0 was the default route.
Checked commits agrare/manageiq-appliance_console@bfc3ed2~...8dc2628 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Changed - Don't depend on eth0 for displaying network information [#263]
When displaying the current network information iterate over all network interfaces not just eth0
Example output:
NOTE with longer interface names the spacing is broken
Related: ManageIQ/manageiq-appliance-build#573