Skip to content

Refactor nacm in klish-plugin-sysrepo after sysrepo change - #1342

Merged
mattiaswal merged 1 commit into
mainfrom
klish-nacm-fixes
Jan 3, 2026
Merged

mattiaswal merged 1 commit into
mainfrom
klish-nacm-fixes

Conversation

@troglobit

@troglobit troglobit commented Jan 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR reverts PR #1335 with a sysrepo neutral change in klish-plugin-sysrepo instead.

Upstream sysrepo commit 90ce1f7 modified sr_nacm_init() to explicitly switch the session to SR_DS_RUNNING before initializing NACM. This broke our klish workflow which started sessions on SR_DS_CANDIDATE.

This commit drops the sysrepo patch that reverts that behavior in favor of explicitly starting sessions on SR_DS_RUNNING for NACM initialization, then switch to SR_DS_CANDIDATE for editing operations. This works with sysrepo's behavior: NACM reads rules from running datastore while our editing workflow operates on candidate datastore.

Also, add prompt path shortening for deep configuration hierarchies.

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe): refactor

Upstream sysrepo commit 90ce1f7 modified sr_nacm_init() to explicitly switch
the session to SR_DS_RUNNING before initializing NACM.  This broke our klish
workflow which started sessions on SR_DS_CANDIDATE.

This commit drops the sysrepo patch that reverts that behavior in favor of
explicitly starting sessions on SR_DS_RUNNING for NACM initialization, then
switch to SR_DS_CANDIDATE for editing operations.  This works with sysrepo's
behavior: NACM reads rules from running datastore while our editing workflow
operates on candidate datastore.

Also, add prompt path shortening for deep configuration hierarchies.

Signed-off-by: Joachim Wiberg <[email protected]>
@troglobit
troglobit requested a review from mattiaswal January 3, 2026 13:20

@mattiaswal mattiaswal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Small but yet important fix in the klish-sysrepo-plugin.

@mattiaswal
mattiaswal merged commit fe86744 into main Jan 3, 2026
7 checks passed
@mattiaswal
mattiaswal deleted the klish-nacm-fixes branch January 3, 2026 14:49
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.

2 participants