Skip to content

Conversation

@richm
Copy link
Contributor

@richm richm commented Sep 3, 2025

Cause: The user is trying to specify the routing table to use by the name of
a built-in routing table defined in /usr/share/iproute2/rt_tables such as main.

Consequence: The network role gives an error:
"cannot find route table main in /etc/iproute2/rt_tables or /etc/iproute2/rt_tables.d/"
The workaround is that the user must specify the table by number instead of name e.g
table: 254 instead of table: main

Fix: Look for table mappings in /usr/share/iproute2/rt_tables as well as the other
paths.

Result: The user can use built-in route table names.

Signed-off-by: Rich Megginson rmeggins@redhat.com

Summary by Sourcery

Enable specifying built-in route tables by name by loading mappings from the system rt_tables file and validate the behavior with new tests

Bug Fixes:

  • Allow using built-in routing tables by name by parsing /usr/share/iproute2/rt_tables

Enhancements:

  • Extend route table mapping lookup order to include system-defined tables before user-defined ones

Tests:

  • Add tests to verify route addition and retrieval for built-in and custom routing tables

Cause: The user is trying to specify the routing table to use by the name of
a built-in routing table defined in /usr/share/iproute2/rt_tables such as `main`.

Consequence: The network role gives an error:
"cannot find route table main in `/etc/iproute2/rt_tables` or `/etc/iproute2/rt_tables.d/`"
The workaround is that the user must specify the table by number instead of name e.g
`table: 254` instead of `table: main`

Fix: Look for table mappings in /usr/share/iproute2/rt_tables as well as the other
paths.

Result: The user can use built-in route table names.

Signed-off-by: Rich Megginson <rmeggins@redhat.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Sep 3, 2025

Reviewer's Guide

Extend route table mapping to recognize built-in tables from /usr/share/iproute2/rt_tables and update tests to verify both built-in (‘main’) and custom named table functionality.

File-Level Changes

Change Details Files
Augment mapping logic to include built-in route tables
  • Parse /usr/share/iproute2/rt_tables before user-defined file
  • Maintain existing parsing of /etc/iproute2/rt_tables for overrides
module_utils/network_lsr/argument_validator.py
Expand test coverage for built-in and custom table names
  • Add tasks to fetch and assert routes from table 'main'
  • Introduce assertions for a new route in the built-in 'main' table
  • Enhance custom table tests with an extra network entry
tests/playbooks/tests_route_table.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@richm
Copy link
Contributor Author

richm commented Sep 3, 2025

@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 43.24%. Comparing base (1b57520) to head (46b71f7).
⚠️ Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
module_utils/network_lsr/argument_validator.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #804      +/-   ##
==========================================
+ Coverage   43.11%   43.24%   +0.12%     
==========================================
  Files          12       12              
  Lines        3124     3122       -2     
==========================================
+ Hits         1347     1350       +3     
+ Misses       1777     1772       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richm
Copy link
Contributor Author

richm commented Sep 3, 2025

[citest]

@richm
Copy link
Contributor Author

richm commented Sep 4, 2025

[citest_bad]

1 similar comment
@richm
Copy link
Contributor Author

richm commented Sep 4, 2025

[citest_bad]

@richm
Copy link
Contributor Author

richm commented Sep 4, 2025

[citest]

@richm
Copy link
Contributor Author

richm commented Sep 4, 2025

cs9 failing - looks like the highavailability repo config is messed up again :-(

@richm richm merged commit 65b5d1a into linux-system-roles:main Sep 4, 2025
37 of 39 checks passed
@richm richm deleted the fix-fall-back-to-usr-share-iproute2-rt_tables branch September 4, 2025 16:35
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.

1 participant