deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: add run_on_instance support to mock driver from JIRA DTACLOUD_212 - thanks to Dies Koper diesk@fast.au.fujitsu.com
Date Fri, 18 May 2012 16:10:27 GMT
Updated Branches:
  refs/heads/master 140765e6d -> 36d79884e


add run_on_instance support to mock driver
from JIRA DTACLOUD_212 - thanks to Dies Koper diesk@fast.au.fujitsu.com

https://issues.apache.org/jira/browse/DTACLOUD-212


Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/36d79884
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/36d79884
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/36d79884

Branch: refs/heads/master
Commit: 36d79884e4375f271fbb4a0b56c9b72c18362be9
Parents: 140765e
Author: marios <marios@redhat.com>
Authored: Fri May 18 19:08:18 2012 +0300
Committer: marios <marios@redhat.com>
Committed: Fri May 18 19:08:18 2012 +0300

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/mock/mock_driver.rb |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/36d79884/server/lib/deltacloud/drivers/mock/mock_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/mock/mock_driver.rb b/server/lib/deltacloud/drivers/mock/mock_driver.rb
index b58872c..9cd233e 100644
--- a/server/lib/deltacloud/drivers/mock/mock_driver.rb
+++ b/server/lib/deltacloud/drivers/mock/mock_driver.rb
@@ -248,6 +248,17 @@ module Deltacloud::Drivers::Mock
       @client.destroy(:instances, id)
     end
 
+    # mock object to mimick Net::SSH object
+    class Mock_ssh
+      attr_accessor :command
+    end
+
+    def run_on_instance(credentials, opts={})
+      ssh = Mock_ssh.new
+      ssh.command = opts[:cmd]
+      Deltacloud::Runner::Response.new(ssh, "This is where the output would appear if this
were not a mock provider")
+    end
+
     #
     # Storage Volumes
     #


Mime
View raw message