fix(distros): clarify misleading ssh_redirect_user warning - #6906
Merged
blackboxsw merged 1 commit intoJun 16, 2026
Conversation
When ssh_redirect_user is set to true or default, cc_users_groups resolves it to the actual default username before create_user runs. The 'no cloud public-keys' warning then printed that resolved name (e.g. 'ubuntu'), making it look like the user had configured 'ubuntu'. Reword the warning so the value reads as the redirect target, not the configured value. Fixes canonicalGH-3924
Collaborator
|
Unrelated unittest failures fixed by #6908 |
blackboxsw
approved these changes
Jun 16, 2026
blackboxsw
left a comment
Collaborator
There was a problem hiding this comment.
Thank you for this contribution. unrelated unittest failures in CI are fixed in a separate PR.
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.
This PR rewords a misleading warning emitted when
ssh_redirect_userisconfigured but no cloud public SSH keys are available.
When
ssh_redirect_useris set totrueordefault,cc_users_groupsresolves it to the actual default username before
create_userruns. The"no cloud public-keys" warning then printed that resolved name (e.g.
ubuntu), making it look like the user had configuredubuntu. Thisrewords the warning so the value reads as the redirect target, not the
configured value.
Fixes GH-3924
Proposed Commit Message
```
fix(distros): clarify misleading ssh_redirect_user warning
When ssh_redirect_user is set to true or default, cc_users_groups
resolves it to the actual default username before create_user runs.
The 'no cloud public-keys' warning then printed that resolved name
(e.g. 'ubuntu'), making it look like the user had configured 'ubuntu'.
Reword the warning so the value reads as the redirect target, not the
configured value.
Fixes GH-3924
```
Additional Context
The warning is emitted in
Distro.create_user(
cloudinit/distros/__init__.py). The value substitution happens earlierin
cc_users_groups, which replaces atrue/defaultssh_redirect_userwith the resolved default username before it reaches
create_user.Test Steps
pytest tests/unittests/distros/test_create_users.py— 59 passed,including
test_create_user_with_ssh_redirect_user_no_cloud_keys.tox -e do_format,tox -e ruff,tox -e mypy, andtox -e pylintlocally — all clean.
Merge type