-
Notifications
You must be signed in to change notification settings - Fork 3k
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
{Compute} az vm/vmss create
: Set file mode when generating Ed25519 SSH keys
#30077
base: dev
Are you sure you want to change the base?
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Compute |
Hi @jiasli, could you please review this PR? |
…erate-ssh-keys-ed25519
s = public_key.public_bytes( | ||
encoding=serialization.Encoding.OpenSSH, | ||
format=serialization.PublicFormat.OpenSSH) | ||
public_key = s.decode(encoding="utf8").replace("\n", "") |
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.
public_bytes
contains bytes
which can be directly written to a file opened as wb
, eliminating the necessity to decode it to a str
.
s = public_key.public_bytes( | ||
encoding=serialization.Encoding.OpenSSH, | ||
format=serialization.PublicFormat.OpenSSH) | ||
public_key = s.decode(encoding="utf8").replace("\n", "") |
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.
Please confirm if removing \n
is necessary.
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 not needed to re-record this file if the HTTP requests don't change.
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.
In fact, I re-record this file just to make sure the change won't bring any unexpected results.
I'll exclude it from the changes.
Related command
az vm/vmss create
Description
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a
: Make some customer-facing breaking change[Component Name 2]
az command b
: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.