From 2d4d3cc5b5802bf53e5389efa8e150c2e33442bd Mon Sep 17 00:00:00 2001 From: Nicholas Ricketts Date: Wed, 5 Oct 2011 17:33:49 -0400 Subject: [PATCH] added linode ssh support --- lib/fog/compute/models/server.rb | 3 +-- lib/fog/linode/models/compute/server.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/fog/compute/models/server.rb b/lib/fog/compute/models/server.rb index 899415450..dfaf78a31 100644 --- a/lib/fog/compute/models/server.rb +++ b/lib/fog/compute/models/server.rb @@ -13,11 +13,10 @@ module Fog Fog::SCP.new(public_ip_address, username, scp_options).upload(local_path, remote_path, upload_options) end - def ssh(commands) + def ssh(commands, options={}) require 'net/ssh' requires :public_ip_address, :username - options = {} options[:key_data] = [private_key] if private_key Fog::SSH.new(public_ip_address, username, options).run(commands) end diff --git a/lib/fog/linode/models/compute/server.rb b/lib/fog/linode/models/compute/server.rb index d6fae9308..e6dca56d3 100644 --- a/lib/fog/linode/models/compute/server.rb +++ b/lib/fog/linode/models/compute/server.rb @@ -13,6 +13,17 @@ module Fog Fog::Compute::Linode::Ips.new :server => self, :connection => connection end + def public_ip_address + ips.last.ip + end + + def username + 'root' + end + + def private_key + end + def disks Fog::Compute::Linode::Disks.new :server => self, :connection => connection end