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

[wip] Correct scanning of non-PCI network devices #1185

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions repos/system_upgrade/common/libraries/persistentnetnames.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ def interfaces():
attrs['name'] = dev.sys_name
attrs['devpath'] = dev.device_path
attrs['driver'] = dev['ID_NET_DRIVER']
Copy link
Member Author

@pirat89 pirat89 Mar 18, 2024

Choose a reason for hiding this comment

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

note it's has been discovered another situation, when ID_NET_DRIVER is not defined and it'S not related to PCI/non-PCI issue. For more info, see RHEL-29551

attrs['vendor'] = dev['ID_VENDOR_ID']
attrs['pci_info'] = PCIAddress(**pci_info(dev['ID_PATH']))
attrs['mac'] = dev.attributes.get('address')
attrs['vendor'] = dev.get('ID_VENDOR_ID', '')
if not attrs['vendor']:
pirat89 marked this conversation as resolved.
Show resolved Hide resolved
attrs['pci_info'] = PCIAddress(**pci_info(dev['ID_PATH']))
else:
# non-PCI
attrs['pci_info'] = None
if isinstance(attrs['mac'], bytes):
attrs['mac'] = attrs['mac'].decode()
except Exception as e: # pylint: disable=broad-except
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Interface(Model):
devpath = fields.String()
driver = fields.String()
vendor = fields.String()
pci_info = fields.Model(PCIAddress)
pci_info = fields.Nullable(fields.Model(PCIAddress))
mac = fields.String()


Expand Down
Loading