-
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
Add LinuxAdmin::NetworkInterface.list #249
Conversation
lib/linux_admin/network_interface.rb
Outdated
private_class_method def self.ip_link | ||
require "json" | ||
|
||
ip_link = Common.run!(Common.cmd("ip"), :params => ["--json", "link"]) |
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 I think the --json
output format would be helpful for e.g. ip addr show
also which currently does some regex parsing of the output but I wanted to leave that for a standalone PR
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.
dc04eb2
to
861f7f8
Compare
|
I think you're looking for the In all seriousness though, |
code-wise LGTM - There are a lot of rubocop issues, and I wasn't sure if the new code was just following an existing pattern, or if this should be cleaned up. |
Yeah that is just how the specs are currently written so I wanted to keep it looking consistent. |
861f7f8
to
19fb4df
Compare
Merged #252 252, but now this is conflict |
Yes this added some ip command mocks so conflict was expected |
Previously there wasn't a method for listing interfaces on the system, which was okay because we assumed an eth0 was available but as we move away from that and use the standard predictable network interface names it would be helpful to get a list.
19fb4df
to
5204709
Compare
Checked commit agrare@5204709 with ruby 3.1.5, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
Rebased |
Breaking Changes: - Use --json for ip command output #251 Added: - Add network interface loopback #254 - Add LinuxAdmin::NetworkInterface.list #249 Changed: - Parse config file on NetworkInterface#reload #253 Test: - Use ruby 3.1 and rails 7 for code coverage #250 - Fix rubocop warnings in NetworkInterface Spec #252 - Update paambaati/codeclimate-action action to v8 #248
Previously there wasn't a method for listing interfaces on the system, which was okay because we assumed an eth0 was available but as we move away from that and use the standard predictable network interface names it would be helpful to get a list.
This can be followed up with attributes indicating if an interface is a LOOPBACK type and if the interface is the dev registered for the default route.
Related ManageIQ/manageiq-appliance-build#573