incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@redhat.com
Subject [PATCH core] Run command on instance support for Rackspace
Date Tue, 01 Feb 2011 14:45:56 GMT
From: Michal Fojtik <mfojtik@redhat.com>

---
 .../drivers/rackspace/rackspace_driver.rb          |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
index e40fb9c..57e1f87 100644
--- a/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
+++ b/server/lib/deltacloud/drivers/rackspace/rackspace_driver.rb
@@ -138,6 +138,20 @@ class RackspaceDriver < Deltacloud::BaseDriver
     instances
   end
 
+  def run_on_instance(credentials, opts={})
+    target = instance(credentials, :id => opts[:id])
+    param = {}
+    param[:credentials] = {
+      :username => 'root',
+      :password => opts[:password]
+    }
+    param[:port] = opts[:port] || '22'
+    param[:ip] = target.public_addresses
+    safely do
+      Deltacloud::Runner.execute(opts[:cmd], param)
+    end
+  end
+
   def valid_credentials?(credentials)
     begin
       new_client(credentials)
-- 
1.7.3.4


Mime
View raw message