lib/fog/compute/models/slicehost/server.rb in fog-0.5.3 vs lib/fog/compute/models/slicehost/server.rb in fog-0.6.0

- old
+ new

@@ -41,19 +41,27 @@ def image requires :image_id connection.images.get(image_id) end + def private_ip_address + nil + end + def private_key_path @private_key_path ||= Fog.credentials[:private_key_path] @private_key_path &&= File.expand_path(@private_key_path) end def private_key @private_key ||= private_key_path && File.read(private_key_path) end + def public_ip_address + addresses.first + end + def public_key_path @public_key_path ||= Fog.credentials[:public_key_path] @public_key_path &&= File.expand_path(@public_key_path) end @@ -97,9 +105,17 @@ requires :addresses, :identity, :username options = {} options[:key_data] = [private_key] if private_key Fog::SSH.new(addresses.first, username, options).run(commands) + end + + def scp(local_path, remote_path) + requires :addresses, :username + + options = {} + options[:key_data] = [private_key] if private_key + Fog::SCP.new(addresses.first, username, options).upload(local_path, remote_path) end def username @username ||= 'root' end