lib/kontena/plugin/upcloud/prompts.rb in kontena-plugin-upcloud-0.3.1 vs lib/kontena/plugin/upcloud/prompts.rb in kontena-plugin-upcloud-0.3.2
- old
+ new
@@ -25,11 +25,11 @@
def default_username
prompt.ask('UpCloud username:', echo: true)
end
def default_password
- pass = prompt.ask('UpCloud password:', echo: false)
+ pass = prompt.mask('UpCloud password:')
end
end
end
module NodeName
@@ -64,10 +64,10 @@
base.option "--zone", "ZONE", "Zone", required: true
base.option "--plan", "PLAN", "Server size", required: true
end
def ssh_key
- return File.read(ssh_key_path) unless ssh_key_path.nil?
+ return File.read(ssh_key_path).strip unless ssh_key_path.nil?
default = File.read(Defaults::DEFAULT_SSH_KEY_PATH).strip rescue nil
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
end