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

Remove separate handling of SSH dir

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 77f097af
......@@ -46,15 +46,6 @@ ssh \
'''
def ensure_ssh_dir():
"""
Ensures the ssh configuration directory exists.
"""
ssh_dir = data_dir('ssh')
if not os.path.exists(ssh_dir):
os.makedirs(ssh_dir)
def ssh_file(filename):
"""
Generates full path to SSH configuration file.
......@@ -139,9 +130,6 @@ def generate_ssh_key(request):
Generates SSH key.
"""
try:
# Create directory if it does not exist
ensure_ssh_dir()
# Actually generate the key
subprocess.check_output(
[
......@@ -167,7 +155,6 @@ def add_host_key(request):
"""
Adds host key for a host.
"""
ensure_ssh_dir()
host = request.POST.get('host', '')
port = request.POST.get('port', '')
if len(host) == 0:
......@@ -226,11 +213,6 @@ def can_generate_key():
"""
Checks whether we can generate key.
"""
try:
ensure_ssh_dir()
except OSError:
return False
return find_executable('ssh-keygen') is not None
......@@ -238,8 +220,6 @@ def create_ssh_wrapper():
"""
Creates wrapper for SSH to pass custom known hosts and key.
"""
ensure_ssh_dir()
ssh_wrapper = ssh_file(SSH_WRAPPER)
with open(ssh_wrapper, 'w') as handle:
......
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