-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix ip_route for appliction_console #257
base: master
Are you sure you want to change the base?
Conversation
On typical systems, ip_route calls `ip route show default` On the mac, ip_route calls `ip route get while` This fixes `ip_route` from failing and fixes an appliance_console bug
Some comments on commit kbrock@e9e80e9 spec/network_interface_spec.rb
|
Checked commit kbrock@e9e80e9 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint lib/linux_admin/distro.rb
lib/linux_admin/homebrew.rb
|
end | ||
end | ||
end | ||
|
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.
Look like you have a bonus line at the end here.
if [Distros.rhel, Distros.fedora].include?(Distros.local) | ||
NetworkInterfaceRH | ||
elsif Distros.local == Distros.darwin | ||
NetworkInterfaceDarwin |
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 wonder if this is cleaner as:
if [Distros.rhel, Distros.fedora].include?(Distros.local) | |
NetworkInterfaceRH | |
elsif Distros.local == Distros.darwin | |
NetworkInterfaceDarwin | |
case Distros.local | |
when Distros.rhel, Distros.fedora | |
NetworkInterfaceRH | |
when Distros.darwin | |
NetworkInterfaceDarwin |
Overall looks good - can you add specs for ip_route method? |
My only other thought is, if we're going all the way to Darwin, should we try to avoid having to install iproute2mac, and use the built-in tools instead? |
I do think at a high level we need to answer "do we want linux_admin to work on mac?" (emphasis on linux here) We can get some of the networking commands to work but there are some other command sets which will not (systemd vs old init.d service, rpm packages, etc...) and we could need something like supports here. |
I think the easy answer is "if it isn't difficult to get it to work we might as well" but how far do we want to go in order to get it to work? |
I'm ok with bringing in things bit by bit to support Mac. Heck, I'd be ok with supporting WSL too at some point :) Agreed on something like |
On typical systems, ip_route calls
ip route show default
On the mac, ip_route callsip route get while
This fixes
ip_route
from failing and fixes an appliance_console bugbefore
after