diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2015-09-10 09:05:53 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2015-09-11 08:50:45 +0000 |
commit | 453e61d0a11d9bf01f803c974d3333751340a4cb (patch) | |
tree | e2fa61d02f14417cb8f12fd821d0514dac8f3a66 | |
parent | 407b82bd84bd2a40cfaa34b70ebe0405c5931720 (diff) | |
download | definitions-453e61d0a11d9bf01f803c974d3333751340a4cb.tar.gz |
Allow to run as non-root user.
-rwxr-xr-x | scripts/release-test-os | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/release-test-os b/scripts/release-test-os index 20339174..44763c36 100755 --- a/scripts/release-test-os +++ b/scripts/release-test-os @@ -167,14 +167,15 @@ class Deployment(object): @staticmethod def _ssh_host_key_exists(hostname): """Check if an ssh host key exists in known_hosts""" - if not os.path.exists('/root/.ssh/known_hosts'): + filename = os.path.expanduser('~/.ssh/known_hosts') + if not os.path.exists(filename): return False - with open('/root/.ssh/known_hosts', 'r') as known_hosts: + with open(filename, 'r') as known_hosts: return any(line.startswith(hostname) for line in known_hosts) def _update_known_hosts(self): if not self._ssh_host_key_exists(self.host_machine.address): - filename = '/root/.ssh/known_hosts'; + filename = os.path.expanduser('~/.ssh/known_hosts') print("No known_hosts: ensuring path"); if not os.path.exists(os.path.dirname(filename)): os.makedirs(os.path.dirname(filename)) |