integration tests OpenSSHTransport: Expand tilde to home in root_ssh_key_filename

Expand paths beginning with a tilde, such as the default ~/.ssh/id_rsa,
to the home directory.

https://fedorahosted.org/freeipa/ticket/4115
This commit is contained in:
Petr Viktorin
2014-01-14 17:16:12 +01:00
parent b351b210be
commit 7b5124416b

View File

@@ -284,7 +284,8 @@ class OpenSSHTransport(Transport):
'-o', 'UserKnownHostsFile=%s' % known_hosts_file]
if self.host.root_ssh_key_filename:
argv.extend(['-i', self.host.root_ssh_key_filename])
key_filename = os.path.expanduser(self.host.root_ssh_key_filename)
argv.extend(['-i', key_filename])
elif self.host.root_password:
self.log.critical('Password authentication not supported')
raise RuntimeError('Password authentication not supported')