Skip to content

qa/cephadm: fix test_set_mon_crush_locations test - #67436

Merged
rkachach merged 1 commit into
ceph:mainfrom
adk3798:cephadm-fix-mon-crush-loc-text
Mar 16, 2026
Merged

rkachach merged 1 commit into
ceph:mainfrom
adk3798:cephadm-fix-mon-crush-loc-text

Conversation

@adk3798

@adk3798 adk3798 commented Feb 19, 2026

Copy link
Copy Markdown
Contributor

This test appears to have been expecting a now
outdated output from ceph mon dump --format json.

This commit modifies the test script to handle
the current format as of writing this on main

{
  "rank": 1,
  "name": "b",
  "public_addrs": {
    "addrvec": [
      {
        "type": "v2",
        "addr": "10.20.193.146:3300",
        "nonce": 0
      },
      {
        "type": "v1",
        "addr": "10.20.193.146:6789",
        "nonce": 0
      }
    ]
  },
  "addr": "10.20.193.146:6789/0",
  "public_addr": "10.20.193.146:6789/0",
  "priority": 0,
  "weight": 0,
  "time_added": "2026-02-19T17:19:05:089735+0000",
  "crush_location": [
    {
      "key": "datacenter",
      "val": "b"
    },
    {
      "key": "rack",
      "val": "2"
    }
  ]
},

indexed under the "mons" key in the json output. The old format would just have k/v pairs as strings e.g. "datacenter=a" as the command still does currently when a format flag is not provided.

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

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

This test appears to have been expecting a now
outdated output from `ceph mon dump --format json`.

This commit modifies the test script to handle
the current format as of writing this on main

    {
      "rank": 1,
      "name": "b",
      "public_addrs": {
        "addrvec": [
          {
            "type": "v2",
            "addr": "10.20.193.146:3300",
            "nonce": 0
          },
          {
            "type": "v1",
            "addr": "10.20.193.146:6789",
            "nonce": 0
          }
        ]
      },
      "addr": "10.20.193.146:6789/0",
      "public_addr": "10.20.193.146:6789/0",
      "priority": 0,
      "weight": 0,
      "time_added": "2026-02-19T17:19:05:089735+0000",
      "crush_location": [
        {
          "key": "datacenter",
          "val": "b"
        },
        {
          "key": "rack",
          "val": "2"
        }
      ]
    },

indexed under the "mons" key in the json output. The old
format would just have k/v pairs as strings e.g. "datacenter=a"
as the command still does currently when a format flag is not
provided.

Signed-off-by: Adam King <[email protected]>
@rkachach

Copy link
Copy Markdown
Contributor

@rkachach rkachach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@rkachach
rkachach merged commit 0f2e745 into ceph:main Mar 16, 2026
6 of 7 checks passed
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