-
Notifications
You must be signed in to change notification settings - Fork 94
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
Dev: utils: Avoid hardcoding the ssh key type as RSA #1600
base: master
Are you sure you want to change the base?
Dev: utils: Avoid hardcoding the ssh key type as RSA #1600
Conversation
1d0afbe
to
75a717f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
75a717f
to
095dd8a
Compare
In utils.ssh_copy_id_no_raise, the ssh key type is hardcoded as RSA. Then the join process will fail if the existing key type is not RSA. Also see: ClusterLabs#1504 (comment)
In KeyFileManager, use class variable to store the key type instead of hardcoding it as RSA.
0ea9007
to
1249b0b
Compare
Replace remote_public_key_from as ssh_key.fetch_public_key_list
…tion - Change the parameter name from 'add' to 'generate_key_on_remote', which is more descriptive. - In the process of join_ssh, no need to set 'generate_key_on_remote' to True, as the init node already has the public key.
And remove unused code.
28aca1d
to
919b465
Compare
to avoid hardcoding the ssh key type as rsa.
919b465
to
8ac3021
Compare
:param with_content: whether to return the content of the public key files, | ||
default is False | ||
|
||
:return: a list of public key files if with_content is False, otherwise a list of public key strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It is a bad idea to return vaules in a same type with different meanings. Please use
Key
in function signature and useKeyFile
andInMemoryKey
correspondingly. Or separate these 2 different usage into 2 functions. typing.List[str]
is deprecated. Uselist[str]
instead.
Problem
Changes include:
ssh_key.fetch_public_key_list
to fetch public keys from local or remote, return as public key path list or public key content list