-
Notifications
You must be signed in to change notification settings - Fork 345
Mac: Nice warning if you don't have an identity #637
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
Mac: Nice warning if you don't have an identity #637
Conversation
Supporting `--all` on mac is "fun" because we rely on ssh auth and, unlike Linux's lovely bind mounts, macOS can't share the ssh authorization directly. Instead we have to carefully bounce the ssh authorization into the container by `ssh`ing into it. One of the steps in this process requires that the user has an ssh identity configured with their agent. This is fairly easy to do, but if you haven't done it the error message was garbage. This catches the original message from `ssh-add` and sends the user a nicer one that includes a link to instructions.
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.
That message looks much better, thanks!
@@ -37,6 +37,7 @@ import time | |||
import webbrowser | |||
|
|||
DOCKER_BUILD_QUIET_TIME = 3 # seconds | |||
SSH_AGENT_HELP = 'https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#adding-your-ssh-key-to-the-ssh-agent' # noqa |
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.
What does # noqa
mean?
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 tells pycodestyle to ignore the super long line.
build_docs
Outdated
@@ -250,6 +251,10 @@ def forward_ssh_auth_into_container(container, docker_run): | |||
handle_popen(get_ssh_public_key, record_public_key) | |||
keys = "\n".join(public_keys) + "\n" | |||
if get_ssh_public_key.returncode != 0: | |||
if 'The agent has no identities.' in keys: | |||
raise ArgError('-all requires an identity be registered with the ' |
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.
s/-all/--all/
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.
Yeah!
Thanks for reviewing @lcawl and @ddillinger! |
Supporting
--all
on mac is "fun" because we rely on ssh auth and, unlikeLinux's lovely bind mounts, macOS can't share the ssh authorization
directly. Instead we have to carefully bounce the ssh authorization into
the container by
ssh
ing into it. One of the steps in this processrequires that the user has an ssh identity configured with their agent.
This is fairly easy to do, but if you haven't done it the error message
was garbage. This catches the original message from
ssh-add
and sendsthe user a nicer one that includes a link to instructions.