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

cli: T6740: add a converter from set commands to config #4124

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

dmbaturin
Copy link
Member

Change Summary

Add new utility vyos-commands-to-config that converts set commands to configs suitable for loading.

Whether we want a CLI completion for it is an open question.

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):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

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

github-actions bot commented Oct 3, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Oct 3, 2024

✅ No issues found in unused-imports check.. Please refer the workflow run

Copy link
Contributor

@jestabro jestabro left a comment

Choose a reason for hiding this comment

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

The following concerns may be purely cosmetic, but it is a timely reminder that we are still relying on the legacy loader and parser to provide:
(1) setting tag data
(2) ordering of nodes

We have explicit mechanisms for both, and if one wants the result of the converter to provide a stand alone config rendered with respect to those constraints, the following patch illustrates the idea:
088fa9a

The approach to (1) there is reasonable and provides a utility that may be otherwise useful to set all tag data long a path; the approach to (2) is a hack by simply reading and re-rendering the result --- we currently order nodes when parsing, not rendering, as we haven't had need of the latter (other than an optional ordering of values for unittests).

It is the author's discretion as to whether we should bother with cosmetic parity for the output.

Copy link

github-actions bot commented Oct 7, 2024

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) ❌ failed
  • Config tests ❌ failed
  • RAID1 tests ❌ failed
  • TPM tests ❌ failed

@jestabro jestabro self-requested a review October 7, 2024 15:36
@jestabro jestabro merged commit f7086df into vyos:current Oct 7, 2024
16 of 18 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