Skip to content

show: don't panic on missing hostnames; show routes without a next hop#37

Open
Shbinging wants to merge 1 commit into
holo-routing:mainfrom
Shbinging:show-no-panic-missing-hostnames
Open

show: don't panic on missing hostnames; show routes without a next hop#37
Shbinging wants to merge 1 commit into
holo-routing:mainfrom
Shbinging:show-no-panic-missing-hostnames

Conversation

@Shbinging

@Shbinging Shbinging commented Jul 13, 2026

Copy link
Copy Markdown

Two issues surfaced once state retrieval worked again:

  1. show isis/ospf adjacency panicked (unwrap() on an Err) when the dynamic-hostname database was absent. Treat the missing container as empty so adjacencies still render with raw system IDs / router IDs.
  2. show isis/ospf route printed nothing for routes with no resolved next hop (e.g. directly-connected). Add an optional() path marker so the row is still emitted with - placeholders. Mark the IS-IS and OSPF next-hop paths optional.

@Shbinging
Shbinging force-pushed the show-no-panic-missing-hostnames branch from fd3ae15 to 18c58b0 Compare July 13, 2026 08:15
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
Shbinging force-pushed the show-no-panic-missing-hostnames branch from 18c58b0 to d8e29c0 Compare July 13, 2026 08:39
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