def upload_ssh_key_stage
return true if ssh_key_uploaded?
upload = paragraph do
agree "Your public SSH key must be uploaded to the OpenShift server to access code. Upload now? (yes|no) "
end
if upload
if ssh_keys.empty?
paragraph do
info "Since you do not have any keys associated with your OpenShift account, "\
"your new key will be uploaded as the 'default' key."
upload_ssh_key('default')
end
else
paragraph { existing_keys_info }
key_fingerprint = fingerprint_for_default_key
unless key_fingerprint
paragraph do
warn "Your ssh public key at #{system_path(RHC::Config.ssh_pub_key_file_path)} is invalid or unreadable. "\
"Setup can not continue until you manually remove or fix your "\
"public and private keys id_rsa keys."
end
return false
end
paragraph do
say "You can enter a name for your key, or leave it blank to use the default name. " \
"Using the same name as an existing key will overwrite the old key."
end
ask_for_key_name
end
else
paragraph do
info "You can upload your SSH key at a later time using the 'rhc sshkey' command"
end
end
true
end