Repository navigation
mgr/smb: disable JSON/YAML key sorting in favor of ordered dicts - #57096
Merged
Merged
Conversation
phlogistonjohn
force-pushed
the
jjm-smb-output-fmt
branch
from
April 30, 2024 19:40
51c1755 to
0f0deec
Compare
phlogistonjohn
marked this pull request as ready for review
April 30, 2024 19:44
When adapating an object to JSON or YAML formatting the previous version of the code always sorted dict keys. This is nice for code that placed no ordering on the dict keys. However, for newer code that may rely on python's sorted dicts we want to be able to disable this behavior. Add two new keyword args to the adapter type that allow disabling the sorting. Signed-off-by: John Mulligan <[email protected]>
Use new adapter class options to disable key sorting for dicts when converting to JSON or YAML. The smb module generally produces dicts based on resource types that have a well defined key order and it's nice to to "jumble it up." Signed-off-by: John Mulligan <[email protected]>
Assert that the show command output is consistent. Signed-off-by: John Mulligan <[email protected]>
When generating JSON/YAML from result objects make the status information and success field placed after the resource summary. This makes it easier to find these fields when reading the output of a command (at least for this reader). Signed-off-by: John Mulligan <[email protected]>
phlogistonjohn
force-pushed
the
jjm-smb-output-fmt
branch
from
May 1, 2024 13:29
0f0deec to
c61a010
Compare
adk3798
approved these changes
May 1, 2024
Contributor
|
failures:
Overall, nothing unexpected in the run |
14 tasks
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.
Depends on #56350
This is the first follow up PR to the new smb mgr module. Instead of trying to fix everything in one giant PR I plan on iterating the smb work over more, smaller, easier to digest, PRs.
This change alters the output of the smb commands so that the JSON/YAML outputs are ordered by the code in a way that should make sense to human readers rather than sorted by the key names.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
opened tracker ticketShow available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e