Skip to content

fix: cover handling of missing match.group("device") in FreeBSD inter… - #54

Merged
a-gorczew merged 1 commit into
mainfrom
bsd_14_4
Aug 10, 2026
Merged

a-gorczew merged 1 commit into
mainfrom
bsd_14_4

Conversation

@adrianlasota

Copy link
Copy Markdown
Contributor

This pull request improves the robustness of interface parsing in the FreeBSD network adapter owner and adds a corresponding unit test to verify the new behavior. The main focus is on handling cases where device data is missing during interface information extraction.

Error handling improvements:

  • network_adapter_owner/freebsd.py: Adds a check for empty device data when parsing interface information, logging a debug message if device data is missing, and uses the safe device_data variable throughout instead of directly accessing the regex group. [1] [2]

Testing enhancements:

Copilot AI review requested due to automatic review settings July 22, 2026 06:44
@mfd-intel-bot

Copy link
Copy Markdown
Contributor

We don't publish DEVs .whl.
To build .whl, run 'pip install git+https://github.com/intel/mfd-network-adapter@bsd_14_4'

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR improves robustness of FreeBSD pciconf interface parsing by handling cases where the optional regex device group is missing, and adds a unit test to validate the new behavior and expected debug logging.

Changes:

  • Add safe handling for missing/empty match.group("device") when building LinuxInterfaceInfo objects in the FreeBSD adapter owner.
  • Emit a module-debug log when device data is missing for an interface.
  • Add a unit test covering the missing-device-data scenario and asserting the debug log message.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
mfd_network_adapter/network_adapter_owner/freebsd.py Makes interface parsing resilient to missing device regex group and logs when device data is empty.
tests/unit/test_mfd_network_adapter/test_network_adapter_owner/test_freebsd_network_owner.py Adds a unit test ensuring missing device data is handled and logged as expected.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…face parsing

Signed-off-by: Lasota, Adrian <adrian.lasota@intel.com>
@a-gorczew
a-gorczew merged commit 724618e into main Aug 10, 2026
23 checks passed
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.

5 participants