deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfoj...@apache.org
Subject [1/3] git commit: CIMI: Added mandatory 'state' property to MachineImage (DTACLOUD-371)
Date Mon, 19 Nov 2012 11:23:55 GMT
Updated Branches:
  refs/heads/master b5680d8cd -> bc54202e5


CIMI: Added mandatory 'state' property to MachineImage (DTACLOUD-371)


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

Branch: refs/heads/master
Commit: bc54202e51f237dd7e5c64592d91fc333821d64b
Parents: 4f6725c
Author: Michal Fojtik <mfojtik@redhat.com>
Authored: Mon Nov 19 12:09:21 2012 +0100
Committer: Michal fojtik <mfojtik@redhat.com>
Committed: Mon Nov 19 12:18:31 2012 +0100

----------------------------------------------------------------------
 server/lib/cimi/models/machine_image.rb   |    2 ++
 server/tests/cimi/data/machine_image.json |    1 +
 server/tests/cimi/data/machine_image.xml  |    1 +
 3 files changed, 4 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/bc54202e/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 4f432fd..3e1e604 100644
--- a/server/lib/cimi/models/machine_image.rb
+++ b/server/lib/cimi/models/machine_image.rb
@@ -17,6 +17,7 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
 
   acts_as_root_entity
 
+  text :state
   href :image_location
   text :image_data
 
@@ -39,6 +40,7 @@ class CIMI::Model::MachineImage < CIMI::Model::Base
     self.new(
       :name => image.id,
       :id => context.machine_image_url(image.id),
+      :state => image.state || 'UNKNOWN',
       :description => image.description,
       :created => Time.now.xmlschema,
       :image_location => { :href => "#{context.driver.name}://#{image.id}" } # FIXME

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/bc54202e/server/tests/cimi/data/machine_image.json
----------------------------------------------------------------------
diff --git a/server/tests/cimi/data/machine_image.json b/server/tests/cimi/data/machine_image.json
index ae83460..c79ab9e 100644
--- a/server/tests/cimi/data/machine_image.json
+++ b/server/tests/cimi/data/machine_image.json
@@ -2,6 +2,7 @@
   "resourceURI": "http://schemas.dmtf.org/cimi/1/MachineImage",
   "id": "http://cimi.example.org/machine_images/1",
   "name": "img1",
+  "state": "AVAILABLE",
   "description": "Machine Image One",
   "created": "2011-11-14",
   "imageLocation": { "href": "nfs://cimi.example.com/images/1.img" },

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/bc54202e/server/tests/cimi/data/machine_image.xml
----------------------------------------------------------------------
diff --git a/server/tests/cimi/data/machine_image.xml b/server/tests/cimi/data/machine_image.xml
index e5b03cf..158460f 100644
--- a/server/tests/cimi/data/machine_image.xml
+++ b/server/tests/cimi/data/machine_image.xml
@@ -3,6 +3,7 @@
   <name>img1</name>
   <description>Machine Image One</description>
   <created>2011-11-14</created>
+  <state>AVAILABLE</state>
   <property key="status">BUILD</property>
   <property key="locked">true</property>
   <imageLocation href="nfs://cimi.example.com/images/1.img"/>


Mime
View raw message