diff options
Diffstat (limited to 'openstack/tester')
-rwxr-xr-x | openstack/tester | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/openstack/tester b/openstack/tester index 583eb80..1643537 100755 --- a/openstack/tester +++ b/openstack/tester @@ -281,7 +281,12 @@ class Deployment(object): def _update_known_hosts(self): if not self._ssh_host_key_exists(self.host_machine.address): - with open('/root/.ssh/known_hosts', 'a') as known_hosts: + filename = '/root/.ssh/known_hosts'; + print("No known_hosts: ensuring path"); + if not os.path.exists(os.path.dirname(filename)): + os.makedirs(os.path.dirname(filename)) + with open(filename, 'a') as known_hosts: + print("Generating known_hosts"); cliapp.runcmd(['ssh-keyscan', self.host_machine.address], stdout=known_hosts) |