deltacloud-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dko...@apache.org
Subject [4/4] git commit: FGCP: exclude system disks from storage_volumes and cimi system volumes. DTACLOUD-532.
Date Mon, 08 Apr 2013 11:42:03 GMT
FGCP: exclude system disks from storage_volumes and cimi system volumes. DTACLOUD-532.


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

Branch: refs/heads/master
Commit: 64a8da06fb7b48fa56497b3699e38fdf4af95f39
Parents: 3033c70
Author: Dies Koper <diesk@fast.au.fujitsu.com>
Authored: Sat Apr 6 21:57:35 2013 +1100
Committer: Dies Koper <diesk@fast.au.fujitsu.com>
Committed: Mon Apr 8 21:41:21 2013 +1000

----------------------------------------------------------------------
 server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb  |    7 ++++---
 .../drivers/fgcp/fgcp_driver_cimi_methods.rb       |    2 +-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64a8da06/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
index 436cb50..9ca65c6 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver.rb
@@ -516,7 +516,8 @@ class FgcpDriver < Deltacloud::BaseDriver
               vdisks['vdisk'].each do |vdisk|
 
                 #state requires an additional call per volume. Only set if attached.
-                #exclude system disks as they are not detachable?
+                #exclude system disks as they are instance disks, not volumes
+                kind = determine_storage_type(vdisk['vdiskId'][0])
                 volumes << StorageVolume.new(
                   :id          => vdisk['vdiskId'][0],
                   :name        => vdisk['vdiskName'][0],
@@ -524,9 +525,9 @@ class FgcpDriver < Deltacloud::BaseDriver
                   :instance_id => vdisk['attachedTo'].nil? ? nil : vdisk['attachedTo'][0],
                   :realm_id    => client.extract_vsys_id(vdisk['vdiskId'][0]),
                   # aligning with rhevm, which returns 'system' or 'data'
-                  :kind        => determine_storage_type(vdisk['vdiskId'][0]),
+                  :kind        => kind,
                   :state       => vdisk['attachedTo'].nil? ? 'AVAILABLE' : 'IN-USE'
-                )
+                ) unless kind == 'system'
               end
             end
           rescue Exception => ex # cater for case where vsys was just destroyed since
list_vsys call

http://git-wip-us.apache.org/repos/asf/deltacloud/blob/64a8da06/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
index 64e434c..9735c62 100644
--- a/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
+++ b/server/lib/deltacloud/drivers/fgcp/fgcp_driver_cimi_methods.rb
@@ -172,7 +172,7 @@ module Deltacloud::Drivers::Fgcp
             :id      => context.system_volume_url(:id => vsys_id, :ent_id => vdisk_id),
             :name    => vdisk['vdiskName'][0],
             :volume  => { :href => context.volume_url(vdisk_id)}
-          ) unless opts[:id] and opts[:id] != vdisk_id
+          ) unless (opts[:id] and opts[:id] != vdisk_id) or determine_storage_type(vdisk_id)
== 'system'
         end
         volumes.compact
       end


Mime
View raw message