Closed kfatehi closed 10 years ago
I had to override this one as well... the issue was that your implementation does not CGI.escape the public key, so the + signs are being converted to spaces when they get to DigitalOcean. Here's my override:
Digitalocean::SshKey.singleton_class.send(:define_method, :create, -> (name, pub_key) { url = "https://api.digitalocean.com/v1/ssh_keys/new/?name=#{name}&ssh_pub_key=#{CGI.escape(pub_key)}&client_id=#{Digitalocean.client_id}&api_key=#{Digitalocean.api_key}" res = Net::HTTP.get(URI(url)) RecursiveOpenStruct.new(JSON.parse(res)) })
didn't notice -- this is a dupe of #27
I had to override this one as well... the issue was that your implementation does not CGI.escape the public key, so the + signs are being converted to spaces when they get to DigitalOcean. Here's my override: