Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
properly append to known hosts
  • Loading branch information
guykisel committed Jul 21, 2017
commit 45a153a617da39c109a66ecb21a3d599482f05dd
9 changes: 7 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ def ssh_keygen(url):
if output.strip():
return
except subprocess.CalledProcessError:
pass
subprocess.check_call(['ssh-keyscan', '-t', 'rsa', url, '>>', '~/.ssh/known_hosts'])
traceback.print_exc()
try:
output = subprocess.check_call(['ssh-keyscan', '-t', 'rsa', url])
with open(os.path.join(os.path.expanduser('~'), '.ssh', 'known_hosts'), 'a') as known_hosts:
known_hosts.write(output)
except Exception:
traceback.print_exc()


def lint(data):
Expand Down