You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by ma...@apache.org on 2013/02/12 18:40:43 UTC

git commit: CIMI: nits to fix failing cimi black-box tests for release 1.1.1

Updated Branches:
  refs/heads/master 5fccc87b1 -> fbd575ffb


CIMI: nits to fix failing cimi black-box tests for release 1.1.1


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

Branch: refs/heads/master
Commit: fbd575ffb3411dbd97fae7840a8aa76eb01c489a
Parents: 5fccc87
Author: marios <ma...@redhat.com>
Authored: Tue Feb 12 19:25:48 2013 +0200
Committer: marios <ma...@redhat.com>
Committed: Tue Feb 12 19:40:23 2013 +0200

----------------------------------------------------------------------
 server/lib/cimi/models/machine.rb       |    2 +-
 server/lib/cimi/models/machine_image.rb |    5 +----
 tests/cimi/part5_test.rb                |    1 +
 tests/cimi/rmd4_test.rb                 |    1 +
 4 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fbd575ff/server/lib/cimi/models/machine.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine.rb b/server/lib/cimi/models/machine.rb
index 0e180ce..4a1c42e 100644
--- a/server/lib/cimi/models/machine.rb
+++ b/server/lib/cimi/models/machine.rb
@@ -133,7 +133,7 @@ class CIMI::Model::Machine < CIMI::Model::Base
 
   def self.delete!(id, context)
     context.driver.destroy_instance(context.credentials, id)
-    CIMI::Model::Machine.new(:id => id).delete
+    new(:id => id).destroy
   end
 
   #returns the newly attach machine_volume

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fbd575ff/server/lib/cimi/models/machine_image.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/models/machine_image.rb b/server/lib/cimi/models/machine_image.rb
index 247ff72..9b5d335 100644
--- a/server/lib/cimi/models/machine_image.rb
+++ b/server/lib/cimi/models/machine_image.rb
@@ -57,13 +57,10 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
       input = XmlSimple.xml_in(request_body.read, {"ForceArray"=>false,"NormaliseSpace"=>2})
       raise 'imageLocation attribute is mandatory' unless input['imageLocation']
       input['property'] ||= {}
-      input['property'].kind_of?(Array) ?
-        input['property'] << { 'image_location' => input['imageLocation'] } : input['property'].merge!('image_location' => input['imageLocation'])
     else
       input = JSON.parse(request_body.read)
       raise 'imageLocation attribute is mandatory' unless input['imageLocation']
       input['properties'] ||= []
-      input['properties'] << { 'image_location' => input['imageLocation'] }
     end
     params = {:id => context.href_id(input["imageLocation"], :machines), :name=>input["name"], :description=>input["description"]}
     image = context.driver.create_image(context.credentials, params)
@@ -77,7 +74,7 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
 
   def self.delete!(image_id, context)
     context.driver.destroy_image(context.credentials, image_id)
-    CIMI::Model::Image.new(:id => image_id).delete
+    new(:id => image_id).destroy
   end
 
 end

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fbd575ff/tests/cimi/part5_test.rb
----------------------------------------------------------------------
diff --git a/tests/cimi/part5_test.rb b/tests/cimi/part5_test.rb
index 8742cbb..566ef26 100644
--- a/tests/cimi/part5_test.rb
+++ b/tests/cimi/part5_test.rb
@@ -37,6 +37,7 @@ class ManipulateAMachine < CIMI::Test::Spec
   machine_created = post(machine_add_uri,
     "<Machine>" +
       "<name>cimi_machine_part5</name>" +
+      "<description> created as part of tests/cimi/part5_test  </description>" +
       "<machineTemplate>" +
         "<machineConfig " +
           "href=\"" + get_a(cep_json, "machineConfig") + "\"/>" +

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/fbd575ff/tests/cimi/rmd4_test.rb
----------------------------------------------------------------------
diff --git a/tests/cimi/rmd4_test.rb b/tests/cimi/rmd4_test.rb
index 9d18c54..b0d6c8c 100644
--- a/tests/cimi/rmd4_test.rb
+++ b/tests/cimi/rmd4_test.rb
@@ -20,6 +20,7 @@ require "test_helper.rb"
 
 class MachinesRMDInitialStates < CIMI::Test::Spec
   @@created_resources ||= {}
+  @@created_resources[:machines] ||= []
   RESOURCE_URI =
   "http://schemas.dmtf.org/cimi/1/Machine"
   ROOTS = ["machine", "resourceMetadata"]