Skip to content

lock: get OS info from lock server first to determine username#2120

Open
deepssin wants to merge 1 commit intoceph:mainfrom
deepssin:update-nodes-get-os-from-lock-server
Open

lock: get OS info from lock server first to determine username#2120
deepssin wants to merge 1 commit intoceph:mainfrom
deepssin:update-nodes-get-os-from-lock-server

Conversation

@deepssin
Copy link
Copy Markdown
Contributor

Try to get os type from lock server before creating Remote object in update_nodes(). This allows us to determine the correct SSH username (root for RPM-based distros, ubuntu for Debian-based) before attempting to connect . avoiding connection failures due to wrong username.

Changes -

  • Add _get_username_for_os_type() helper function
  • Query lock server for OS info in update_nodes()
  • Create Remote with correct username based on OS type
  • Add fallback logic if connection fails with determined username

This fixes issues where update_nodes() fails on CentOS/RHEL machines because it tries to connect with default ubuntu username instead of 'root'.

Try to get OS type from lock server before creating Remote object
in update_nodes(). This allows us to determine the correct SSH username
(root for RPM-based distros, ubuntu for Debian-based) before attempting
to connect, avoiding connection failures due to wrong username.

Changes:
- Add _get_username_for_os_type() helper function
- Query lock server for OS info in update_nodes()
- Create Remote with correct username based on OS type
- Add fallback logic if connection fails with determined username

This fixes issues where update_nodes() fails on CentOS/RHEL machines
because it tries to connect with default 'ubuntu' username instead
of 'root'.

Signed-off-by: deepssin <deepssin@redhat.com>
@deepssin deepssin requested a review from a team as a code owner December 24, 2025 12:34
@deepssin deepssin requested review from kamoltat and zmc and removed request for a team December 24, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant