deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [1/4] git commit: CIMI: use storage volume name for cimi volume name if available, else id. https://issues.apache.org/jira/browse/DTACLOUD-535
Date Mon, 08 Apr 2013 11:42:00 GMT
Updated Branches:
  refs/heads/master 0c7f632f1 -> 64a8da06f


CIMI: use storage volume name for cimi volume name if available, else id.
https://issues.apache.org/jira/browse/DTACLOUD-535


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

Branch: refs/heads/master
Commit: 3082294909933a8bbc2ad044781429e93bd28f93
Parents: 0c7f632
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Sat Apr 6 21:54:56 2013 +1100
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Mon Apr 8 21:38:42 2013 +1000

----------------------------------------------------------------------
 server/lib/cimi/service/machine_volume.rb |    4 ++--
 server/lib/cimi/service/volume.rb         |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/30822949/server/lib/cimi/service/machine_volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/machine_volume.rb b/server/lib/cimi/service/machine_volume.rb
index 77c545b..35397df 100644
--- a/server/lib/cimi/service/machine_volume.rb
+++ b/server/lib/cimi/service/machine_volume.rb
@@ -22,7 +22,7 @@ class CIMI::Service::MachineVolume < CIMI::Service::Base
         id = context.machine_url(instance_id)+"/volumes/#{vol.id}"
         attached <<  self.new(context, :values => {
           :id => id,
-          :name => vol.id,
+          :name => volume.name || vol.id,
           :description => "MachineVolume #{vol.id} for Machine #{instance_id}",
           :created => vol.created.nil? ? nil : Time.parse(vol.created).xmlschema,
           :initial_location => vol.device,
@@ -37,7 +37,7 @@ class CIMI::Service::MachineVolume < CIMI::Service::Base
       raise CIMI::Model::NotFound unless vol.instance_id == instance_id
       self.new(context, :values => {
         :id => id,
-        :name => vol.id,
+        :name => volume.name || vol.id,
         :description => "MachineVolume #{vol.id} for Machine #{instance_id}",
         :created => vol.created.nil? ? nil : Time.parse(vol.created).xmlschema,
         :initial_location => vol.device,

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/30822949/server/lib/cimi/service/volume.rb
----------------------------------------------------------------------
diff --git a/server/lib/cimi/service/volume.rb b/server/lib/cimi/service/volume.rb
index 2e38691..969da43 100644
--- a/server/lib/cimi/service/volume.rb
+++ b/server/lib/cimi/service/volume.rb
@@ -48,7 +48,7 @@ class CIMI::Service::Volume < CIMI::Service::Base
 
   def self.from_storage_volume(volume, context)
     self.new(context, :values => {
-      :name => volume.id,
+      :name => volume.name || volume.id,
       :created => volume.created.nil? ? nil : Time.parse(volume.created).xmlschema,
       :id => context.volume_url(volume.id),
       :capacity => context.to_kibibyte(volume.capacity, 'GB'),


Mime
View raw message