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

Enable password protected SSH keys. #2044

Merged
merged 1 commit into from
Mar 10, 2017
Merged

Conversation

brendandburns
Copy link
Member

Fixes: #1773

@derekbekoe derekbekoe added the ACS az acs/aks/openshift label Feb 28, 2017
@@ -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 "$@"
Copy link
Member

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?

Copy link
Member Author

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()
Copy link
Member

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.

Copy link
Member Author

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()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

@brendandburns
Copy link
Member Author

Refactored to avoid the parameter which I decided felt wonky.

@codecov-io
Copy link

codecov-io commented Mar 8, 2017

Codecov Report

Merging #2044 into master will decrease coverage by -0.04%.
The diff coverage is 29.41%.

@@            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
Impacted Files Coverage Δ
...li-acs/azure/cli/command_modules/acs/acs_client.py 54.9% <29.41%> (-5.33%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b77c3c...bac7197. Read the comment docs.

Copy link
Contributor

@troydai troydai left a 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

Copy link
Member

@derekbekoe derekbekoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@troydai troydai merged commit 9abbb0e into Azure:master Mar 10, 2017
@ashb
Copy link

ashb commented Mar 10, 2017

What about using the SSH agent?

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.

None yet

6 participants