deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject git commit: CIMI - fix stop/restart actions on Machine (DTACLOUD-367 and DTACLOUD-368)
Date Wed, 14 Nov 2012 09:28:23 GMT
Updated Branches:
  refs/heads/master 5ed52fc7a -> d8392739f


CIMI - fix stop/restart actions on Machine (DTACLOUD-367 and DTACLOUD-368)

https://issues.apache.org/jira/browse/DTACLOUD-367
https://issues.apache.org/jira/browse/DTACLOUD-368


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

Branch: refs/heads/master
Commit: d8392739f02ad8f5b269390250afd11be81b9394
Parents: 5ed52fc
Author: marios <marios@redhat.com>
Authored: Wed Nov 14 11:15:19 2012 +0200
Committer: marios <marios@redhat.com>
Committed: Wed Nov 14 11:27:57 2012 +0200

----------------------------------------------------------------------
 server/lib/cimi/collections/machines.rb            |    6 +++---
 server/lib/cimi/models/machine.rb                  |    2 +-
 .../drivers/openstack/openstack_driver.rb          |    8 ++++----
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d8392739/server/lib/cimi/collections/machines.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/collections/machines.rb b/server/lib/cimi/collections/machines.rb
index 6fdfbc2..1ae71e6 100644
--- a/server/lib/cimi/collections/machines.rb
+++ b/server/lib/cimi/collections/machines.rb
@@ -85,15 +85,15 @@ module CIMI::Collections
         end
       end
 
-      action :restart, :with_capability => :restart_instance do
+      action :restart, :with_capability => :reboot_instance do
         description "Start specific machine."
         param :id,          :string,    :required
         control do
           machine = Machine.find(params[:id], self)
           if request.content_type.end_with?("json")
-            action = Action.from_json(request.body.read)
+            action = Action.from_json(request.body.read.gsub("restart", "reboot"))
           else
-            action = Action.from_xml(request.body.read)
+            action = Action.from_xml(request.body.read.gsub("restart", "reboot"))
           end
           machine.perform(action, self) do |operation|
             no_content_with_status(202) if operation.success?

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d8392739/server/lib/cimi/models/machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
index 648c395..1958806 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -79,7 +79,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
 
   def perform(action, context, &block)
     begin
-      if context.driver.send(:"#{action.name}_instance", context.credentials, self.name)
+      if context.driver.send(:"#{action.name}_instance", context.credentials, self.id.split("/").last)
         block.callback :success
       else
         raise "Operation failed to execute on given Machine"

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/d8392739/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
index 0f3c97a..6425d1b 100644
--- a/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
+++ b/server/lib/deltacloud/drivers/openstack/openstack_driver.rb
@@ -173,10 +173,10 @@ module Deltacloud
           end
           if opts[:keyname] && opts[:keyname].length > 0
             params[:key_name]=opts[:keyname]
-	  end
-	  if opts[:user_data] && opts[:user_data].length > 0
-	    params[:user_data]=Base64.encode64(opts[:user_data])
-	  end
+          end
+          if opts[:user_data] && opts[:user_data].length > 0
+            params[:user_data]=Base64.encode64(opts[:user_data])
+          end
           safely do
             server = os.create_server(params)
             result = convert_from_server(server, os.connection.authuser)


Mime
View raw message