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

Do not attempt to parse empty file

parent ef1f34a1
......@@ -250,6 +250,7 @@ def ssh(request):
# Read key data if it exists
if os.path.exists(RSA_KEY_FILE):
key_data = file(RSA_KEY_FILE).read()
if len(key_data) > 0:
key_type, key_fingerprint, key_id = key_data.strip().split(None, 2)
key = {
'key': key_data,
......@@ -259,6 +260,8 @@ def ssh(request):
}
else:
key = None
else:
key = None
# Add host key
if action == 'add-host':
......
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