Skip to content

mgr/orchestrator: show how to give orch host add more than one label - #67071

Merged
rkachach merged 1 commit into
ceph:mainfrom
anthonyeleven:fix-host-add-usage
Oct 7, 2026
Merged

rkachach merged 1 commit into
ceph:mainfrom
anthonyeleven:fix-host-add-usage

Conversation

@anthonyeleven

@anthonyeleven anthonyeleven commented Jan 25, 2026 •

Copy link
Copy Markdown
Contributor

The usage line the CLI generates for ceph orch host add is

orch host add <hostname> [<addr>] [<labels>...] [--maintenance] :  Add a host

Nothing in it says how to give more than one label. Two forms work: --labels with a comma-separated list (added by the https://tracker.ceph.com/issues/50062 fix), or labels listed after <addr> separated by spaces. The positional form needs <addr>; without it, ceph orch host add host1 mylabel takes mylabel as the address, which is the #50062 confusion.

The command's signature is unchanged, so every form that works today keeps working. The command's description, which the CLI prints after the usage line, now gives the multi-label syntax:

orch host add <hostname> [<addr>] [<labels>...] [--maintenance] :  Add a host. For more than one label, use --labels label1,label2,... or list them after <addr> separated by spaces (without <addr>, the first label is taken as the address).

The docs now show the --labels form in the synopsis, with a multi-label example.

Tested: orchestrator/tests (28 passed) and flake8 under the mgr tox config (clean). The parse behavior above was checked with ceph_argparse.validate_command against the generated signature.

Fixes: https://tracker.ceph.com/issues/81492

Assisted by Claude Opus-5.5

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.

@bluikko

bluikko commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

Docs lgtm. Seems like PR 66835 might need to be backported before this one, I'll put that to the top of the queue next week if you intend to backport this.

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

I tend to mess things up trying to backport, but go for it if you have the chops. This is relatively minor.

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test make check arm64

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins make check

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test make check

1 similar comment
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

1 similar comment
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

orchestrator/module.py:501:9: F841 local variable 'usage' is assigned to but never used
1     F841 local variable 'usage' is assigned to but never used

https://jenkins.ceph.com/job/ceph-pull-requests/175713/consoleFull#-1799367217e840cee4-f4a4-4183-81dd-42855615f2c1

batrick
batrick previously requested changes Mar 4, 2026
Comment thread src/pybind/mgr/orchestrator/module.py Resolved
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

The button to accept Patrick's suggest claims to sign off the new commit, which didn't used to happen, so hopefully that doesn't mess things up here now.

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

1 similar comment
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label May 8, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Jun 7, 2026
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

Bump

@anthonyeleven anthonyeleven reopened this Jun 7, 2026
@github-actions github-actions Bot removed the stale label Jun 7, 2026
Comment thread src/pybind/mgr/orchestrator/module.py Outdated
Comment on lines +502 to +505
"""Add a host
Usage:
ceph orch host add <newhost> [<ip>] [--labels <label1>[,<label2>...]]
"""

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.

The indent here is invalid and will cause a syntax error (not merely a linter error). The opening triple quote must be aligned with the same level of indent the previous code had.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions Bot added the stale label Aug 7, 2026
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions Bot closed this Sep 6, 2026
@anthonyeleven anthonyeleven reopened this Oct 6, 2026
@anthonyeleven anthonyeleven changed the title CLI: Fix ceph orch host add usage message mgr/orchestrator: say how to give orch host add labels without an address Oct 6, 2026
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

Reopened and reworked, rebased onto current main as two commits (code, docs):

  • Code: the only change to _add_host is a correctly indented docstring. There's no usage variable, so the F841 is gone, and the accepted suggestion's column-0 indentation is fixed. Per @rkachach's point, the CLI infra already prints the usage line, so the docstring just says how labels work. Its text is appended to that line.
  • Behavior is unchanged on purpose. Moving labels behind _end_positional_ would make the generated usage read [--labels <value>...], but it would also reject host add h1 10.0.0.1 mon osd and --labels mon osd, which both work today.
  • Docs: unchanged from the version @bluikko approved, rebased.

Tests: orchestrator/tests 28 passed, and flake8 is clean under the mgr tox config.

Assisted by Claude Opus-5.5

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

Squashed into one commit, as requested. The tracker for backports is https://tracker.ceph.com/issues/81492, and the description now references it.

The usage line the CLI builds for orch host add is

  orch host add <hostname> [<addr>] [<labels>...] [--maintenance]

and the command's description is only "Add a host", so nothing says how
to give more than one label. Two forms work: --labels with a
comma-separated list, or labels listed after <addr> separated by spaces.
The positional form needs <addr>; without it, "ceph orch host add host1
mylabel" takes mylabel as the address.

Say so in the description, which the CLI prints after the usage line,
and show the --labels form, with a multi-label example, in the host
management docs.

Signed-off-by: Anthony D'Atri <[email protected]>
Assisted by Claude Opus-5.5
@anthonyeleven anthonyeleven changed the title mgr/orchestrator: say how to give orch host add labels without an address mgr/orchestrator: show how to give orch host add more than one label Oct 6, 2026
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

I reworded the docstring and the description around the actual gap: nothing in the old message showed how to give more than one label. The code change is still docstring-only, in one commit.

@anthonyeleven
anthonyeleven dismissed stale reviews from phlogistonjohn and batrick October 6, 2026 15:26

code now works

@github-actions github-actions Bot removed the stale label Oct 6, 2026
@anthonyeleven

Copy link
Copy Markdown
Contributor Author

failures appear to be unrelated.

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test dashboard cephadm

@anthonyeleven

Copy link
Copy Markdown
Contributor Author

jenkins test rook e2e

@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 cd3b4f0 into ceph:main Oct 7, 2026
16 of 18 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.

6 participants