[config] Support interface ranges with --from and --to - #4822
Draft
dlanov wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Dennis Lanov <dennis.lanov@gmail.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
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.
[config] Support interface ranges with --from and --to
What I did
Added
--fromand--tooptions toconfig interface startupandconfig interface shutdownto operate on an inclusive range of configured physical interfaces.This implements the syntax suggested in #790 while preserving the existing positional single-interface, comma-list, and dash-range behavior.
Examples:
How I did it
--from/--tooptions toconfig interface startupandshutdown.PORTtable.--fromand--toendpoints individually in interface alias mode.doc/Command-Reference.md.For example, if configured ports are:
then
--from Ethernet0 --to Ethernet40operates only on those configured ports and does not generate nonexistent interfaces such asEthernet1,Ethernet2, orEthernet3.How to verify it
Local validation completed successfully:
Targeted unit tests were added to
tests/config_test.py.The full unit test environment requires SONiC-specific dependencies such as
sonic_py_commonandswsscommon, which are not available in the local WSL environment. The PR CI environment can run the complete dependency-backed checks.Previous command output
Existing positional syntax remains unchanged, for example:
New command output
New range syntax:
Fixes #790