Skip to content

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

Merged
merged 3 commits into from
Feb 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build_docs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Choose a reason for hiding this comment

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

What does # noqa mean?

Copy link
Member Author

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.


DIR = dirname(realpath(__file__))
logger = logging.getLogger('build_docs')
Expand Down Expand Up @@ -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 '
'ssh-agent on macOS. See ' + SSH_AGENT_HELP + ' '
'for instructions.')
raise subprocess.CalledProcessError(get_ssh_public_key.returncode,
cmd, keys)

Expand Down Expand Up @@ -451,6 +456,8 @@ if __name__ == '__main__':
exit(1)
except subprocess.CalledProcessError as e:
print(e)
if e.output:
print(e.output)
exit(e.returncode)
except KeyboardInterrupt:
# Just quit if we get ctrl-c
Expand Down