From b13cbe4730a986a3b60c4c70ce2b5f16da8a4feb Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 15 Sep 2016 22:21:38 -0700 Subject: leap vm: grab ssh host key when adding a new vm --- lib/leap_cli/commands/vm.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/leap_cli/commands') diff --git a/lib/leap_cli/commands/vm.rb b/lib/leap_cli/commands/vm.rb index b1911596..790774f1 100644 --- a/lib/leap_cli/commands/vm.rb +++ b/lib/leap_cli/commands/vm.rb @@ -253,6 +253,16 @@ module LeapCli; module Commands if server cloud.bind_server_to_node(server) + ssh_host_key = cloud.wait_for_ssh_host_key(server) + if ssh_host_key.nil? + log :warning, "We could not get a SSH host key." do + log "Try running `leap vm add #{node.name}` again later." + end + else + log :saving, "SSH host key for #{node.name}" + write_file! [:node_ssh_pub_key, node.name], ssh_host_key.to_s + end + log "done", :color => :green, :style => :bold end end -- cgit v1.2.3