Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] List root ssh keys #1788

Merged
merged 1 commit into from Feb 29, 2024
Merged

[fix] List root ssh keys #1788

merged 1 commit into from Feb 29, 2024

Conversation

zamentur
Copy link
Member

@zamentur zamentur commented Feb 29, 2024

The problem

When we try to list ssh keys we get this message.

# yunohost user ssh list-keys root
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 77, in <module>
    yunohost.cli(
  File "/usr/lib/python3/dist-packages/yunohost/__init__.py", line 41, in cli
    ret = moulinette.cli(
  File "/usr/lib/python3/dist-packages/moulinette/__init__.py", line 110, in cli
    Cli(
  File "/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py", line 503, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 580, in process
    return func(**arguments)
  File "/usr/lib/python3/dist-packages/yunohost/user.py", line 1430, in user_ssh_list_keys
    return yunohost.ssh.user_ssh_list_keys(username)
  File "/usr/lib/python3/dist-packages/yunohost/ssh.py", line 36, in user_ssh_list_keys
    user["homeDirectory"][0], ".ssh", "authorized_keys"
KeyError: 'homeDirectory'

Solution

Make _get_use_for_ssh() returns a dict with good keys

PR Status

Ready

How to test

yunohost user ssh list-keys root

@alexAubin alexAubin merged commit 345ad8c into dev Feb 29, 2024
1 of 2 checks passed
@zamentur zamentur added the micro Micro decision label Feb 29, 2024
@alexAubin alexAubin deleted the fix-root-ssh-keys branch February 29, 2024 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants