Skip to content

mgr/smb: disable JSON/YAML key sorting in favor of ordered dicts - #57096

Merged
adk3798 merged 4 commits into
ceph:mainfrom
phlogistonjohn:jjm-smb-output-fmt
May 10, 2024
Merged

adk3798 merged 4 commits into
ceph:mainfrom
phlogistonjohn:jjm-smb-output-fmt

Conversation

@phlogistonjohn

Copy link
Copy Markdown
Contributor

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 x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

@phlogistonjohn phlogistonjohn changed the title Jjm smb output fmt mgr/smb: disable JSON/YAML key sorting in favor of ordered dicts Apr 25, 2024
@phlogistonjohn
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]>
@adk3798

adk3798 commented May 10, 2024

Copy link
Copy Markdown
Contributor

https://pulpito.ceph.com/adking-2024-05-09_03:09:40-orch:cephadm-wip-adk-testing-2024-05-08-1927-distro-default-smithi/

failures:

  • 21 in cluster log type failures that are still being cleaned up, known issue
  • 3 mds_upgrade_sequence failures, known issue
  • 1 test failed installing ceph-fuse Status code: 503 for https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=x86_64&protocol=https,http, happens on occasion, nothing to block merging over

Overall, nothing unexpected in the run

@adk3798
adk3798 merged commit 43a6601 into ceph:main May 10, 2024
@phlogistonjohn
phlogistonjohn deleted the jjm-smb-output-fmt branch June 13, 2024 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants