op-mode: T6498: add machine-readable tech support report script #3746
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.
Change Summary
This PR adds two new commands:
Types of changes
Component(s) name
Op mode.
Proposed changes
The scrips outputs its data in JSON for now: first to integrate with the normal machine-readable op mode system; second, because existing Python TOML writers aren't that great and don't produce multi-line strings, etc. — we can reconsider that if we make a writer or find a good one.
But we'll likely need to also add a format option to
vyos.opmode
because right now it assumes that all output must be JSON.Things that are truly machine-readable:
Things that are embedded as strings:
Configs are anonymized using the code from the ill-fated PR to improve the
strip-private
filter. Even though that code turned out to be insufficient for the filter because the filter isn't aware of the config path, for this purpose they are fine because the tech support report only includes complete configs.P.S.
To my dismay, I found that a bunch of Linux utils, including
ip
,parted
, and several FRR commands produce invalid JSON that cannot be parsed. I'll follow up with patches to upstream projects to fix that.How to test
Smoketest result
Checklist: