GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix find_children_w_parents to include only real descendants by kat-git-hub · Pull Request #900 · networktocode/netutils

Conversation

@kat-git-hub

@kat-git-hub kat-git-hub commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #836

find_children_w_parents grouped lines by their top level parent instead of the actual matched line. So matching one child pulled in every sibling under the same parent, even ones that don't match the pattern at all.

Example from the issue:

parsed.find_children_w_parents(parent_pattern="context local", child_pattern=" logging", match_type="regex")

Before it also returned "something not logging". Now only the two logging lines come back.

Also updated the existing ios_full_received.txt fixture. It expected contact-email-addr to be included alongside profile "CiscoTAC-1", but contact-email-addr doesn't match the test's child_pattern at all, it's just a sibling under call-home. Same bug, just baked into the expected test output. Added a separate flat_siblings test case for the exact issue scenario.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kat-git-hub
Fix find_children_w_parents to only include actual descendants of mat…
62966a0
…ched child (networktocode#836)
@kat-git-hub
kat-git-hub requested review from itdependsnetworks and jeffkala as code owners September 2, 2026 07:26
@jeffkala

jeffkala commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution @kat-git-hub; how is this PR different than #837

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kat-git-hub

kat-git-hub commented Sep 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@jeffkala Sorry, I hadn't seen #837 before opening this PR.
From what I can tell, #837 started out fixing the same bug, but a later commit added the parent config line to the output too, seemingly to support a Golden Config use case. This PR sticks to exactly what the issue asked for, only the matched child lines and their descendants, without the parent line.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@itdependsnetworks itdependsnetworks Awaiting requested review from itdependsnetworks itdependsnetworks is a code owner
@jeffkala jeffkala Awaiting requested review from jeffkala jeffkala is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: BaseSpaceConfigParser.find_children_w_parents()

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kat-git-hub @jeffkala
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.