show: don't panic on missing hostnames; show routes without a next hop#37
Open
Shbinging wants to merge 1 commit into
Open
show: don't panic on missing hostnames; show routes without a next hop#37Shbinging wants to merge 1 commit into
Shbinging wants to merge 1 commit into
Conversation
Shbinging
force-pushed
the
show-no-panic-missing-hostnames
branch
from
July 13, 2026 08:15
fd3ae15 to
18c58b0
Compare
Two schema/data-shape mismatches surfaced once state retrieval worked again: 1. `show isis adjacency` (and the OSPF neighbor/database commands) panicked with a `Result::unwrap()` on an Err whenever the dynamic-hostname database was absent. isis_hostnames()/ospf_hostnames() unwrap `find_path()` on the `hostnames` container, but that container only exists once the instance has learned a hostname; on an instance with none (or no instance at all) `find_path` returns "not found" and the CLI aborted. Handle the absent container as an empty mapping so adjacencies still render with raw system IDs / router IDs. 2. `show isis route` / `show ospfv2 route` printed nothing for routes that have no resolved next hop (e.g. directly-connected prefixes). YangTableBuilder only emits a row at the deepest path, so a route whose `next-hops/next-hop` list is empty produced zero rows and was silently dropped. Add an `optional()` marker for a path: when it has no instance, the row is still emitted with "-" placeholders for that path's columns. Mark the IS-IS and OSPF next-hop paths optional. (RIP route is unaffected: its next-hop fields are plain leaves, not a nested list.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Shbinging
force-pushed
the
show-no-panic-missing-hostnames
branch
from
July 13, 2026 08:39
18c58b0 to
d8e29c0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two issues surfaced once state retrieval worked again:
show isis/ospf adjacencypanicked (unwrap()on anErr) when the dynamic-hostname database was absent. Treat the missing container as empty so adjacencies still render with raw system IDs / router IDs.show isis/ospf routeprinted nothing for routes with no resolved next hop (e.g. directly-connected). Add anoptional()path marker so the row is still emitted with-placeholders. Mark the IS-IS and OSPF next-hop paths optional.