-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Enable password protected SSH keys. #2044
Conversation
91bff56
to
7dbf7f5
Compare
e964084
to
825e5b8
Compare
scripts/run_tests
Outdated
@@ -5,4 +5,4 @@ | |||
# Licensed under the MIT License. See License.txt in the project root for license information. | |||
# -------------------------------------------------------------------------------------------- | |||
|
|||
python -m automation.tests.run "$@" | |||
python3 -m automation.tests.run "$@" |
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.
CI is failing because of this on Python 2.
Can you revert this 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.
This must be a weird rebase thing, fixed.
pkey = None | ||
key_pass = None | ||
if key_password: | ||
key_pass = getpass.getpass() |
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.
Can you use the centralized azure.cli.core.prompting prompt_pass()
method for this?
This has centralized logic for checking if tty is available.
Then you can choose how to handle the NoTTYException
in here.
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.
done.
pkey = paramiko.RSAKey.from_private_key_file(key_filename, key_pass) | ||
except paramiko.PasswordRequiredException: | ||
if key_pass is None: | ||
key_pass = getpass.getpass() |
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.
Same here.
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.
done.
Refactored to avoid the parameter which I decided felt wonky. |
Codecov Report
@@ Coverage Diff @@
## master #2044 +/- ##
==========================================
- Coverage 72.33% 72.29% -0.04%
==========================================
Files 323 323
Lines 18273 18287 +14
Branches 2701 2702 +1
==========================================
+ Hits 13217 13220 +3
- Misses 4221 4232 +11
Partials 835 835
Continue to review full report at Codecov.
|
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.
Looks good to me. @derekbekoe
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.
LGTM
What about using the SSH agent? |
Fixes: #1773