Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-mode: T6580: read active nodes directly from the config tree without calling cli-shell-api #3811

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

dmbaturin
Copy link
Member

Change Summary

For op mode completion purposes, we only need to care about nodes in the active config, so none of the complexities of config sessions apply. In the current implementation that uses a directory tree for the config tree, that's equivalent to ls.

The task is made easier by the fact that op mode template interpreter doesn't care about exit codes, so even if ls exits with a non-zero code on non-existent dirs, that has no negative effects, we can just supress its error output with ls 2>/dev/null. And node names cannot contain whitespace, so we can always use them in UNIX path strings without escaping.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): performance optimization.

Related Task(s)

Related PR(s)

Component(s) name

Op mode.

How to test

Every command that uses a node path in completion, like run show interfaces, should work as before.

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

👍
No issues in PR Title / Commit Title

Copy link

👍
No issues in unused-imports

Copy link

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests ❌ failed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed

@c-po c-po enabled auto-merge July 17, 2024 11:01
@c-po c-po merged commit 918be57 into vyos:current Jul 17, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants