Commit e6c2dd44 authored by Michal Čihař's avatar Michal Čihař

Simplify detection whether ssh-keygen works

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 4b69215c
......@@ -225,16 +225,18 @@ def can_generate_key():
return False
try:
ret = subprocess.check_call(
['which', 'ssh-keygen'],
process = subprocess.Popen(
['ssh-keygen', '--help'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
env=get_clean_env(),
)
return ret == 0
except subprocess.CalledProcessError:
except OSError:
return False
# ssh-keygen does not support --help, it exits with 1
return process.wait() in (0, 1)
def create_ssh_wrapper():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment