lib/kontena/plugin/digital_ocean/prompts.rb in kontena-plugin-digitalocean-0.3.1 vs lib/kontena/plugin/digital_ocean/prompts.rb in kontena-plugin-digitalocean-0.3.2

- old
+ new

@@ -12,11 +12,10 @@ def ask_ssh_key(do_token) manager = Kontena::Machine::DigitalOcean::SshKeyManager.new(do_token) if self.ssh_key - puts self.ssh_key.inspect public_key = File.read(self.ssh_key).strip else keys = manager.list key = :new @@ -39,14 +38,13 @@ public_key = prompt.ask('SSH public key: (enter an ssh key in OpenSSH format "ssh-xxx xxxxx key_name")', default: default) do |q| q.validate /^ssh-rsa \S+ \S+$/ end else - public_key = key.public_key + return key.id end - - manager.find_or_create_by_public_key(public_key).id end + manager.find_or_create_by_public_key(public_key).id end def ask_do_token if self.token.nil? prompt.ask('DigitalOcean API token:', echo: false)