Skip to content
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

[networking] call ethtool for proper vlan device names #1458

Conversation

pmoravec
Copy link
Contributor

Dont rely on device names from "ip -o link" output where the names
contain also physical device name. Rather get the list of device names
from listing /sys/class/net/ directory.

Resolves: #1458

Signed-off-by: Pavel Moravec pmoravec@redhat.com


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname email@example.com?

Dont rely on device names from "ip -o link" output where the names
contain also physical device name. Rather get the list of device names
from listing /sys/class/net/ directory.

Resolves: sosreport#1458

Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
@pmoravec
Copy link
Contributor Author

Kudos to Jonathan Maxwell from Red Hat who wrote the patch.

Copy link
Member

@bmr-cymru bmr-cymru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like a better solution for trawling the namespace, but we can go with this if there's nothing forthcoming in time.

I think it's actually quite easy to implement ns_listdir(ns, dir) natively in Python here.

ns_cmd_prefix = cmd_prefix + namespace + " "
ns_cmd_prefix = cmd_prefix + namespace + " "
netns_netdev_list = self.call_ext_prog(ns_cmd_prefix +
"ls -1 /sys/class/net/")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason not to use os.listdir() here? It is typically cleaner than shelling out to ls...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, OK. The ns prefix. I wonder if there isn't a better way to do that, it's kinda fugly...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, haven't found a direct pythonic way outside calling shell. I can add a comment if it clarifies the code..?

@bmr-cymru bmr-cymru closed this in 3766c4e Mar 18, 2019
@bmr-cymru bmr-cymru modified the milestone: 3.7 Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants