* Treating sim_disk['role'] == None as Free disk.

Signed-off-by: Gris Ge <f...@redhat.com>
---
 plugin/sim/simarray.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index 3fa7782..c3d2051 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -194,7 +194,7 @@ class BackStore(object):
 
     DISK_KEY_LIST = [
         'id', 'name', 'total_space', 'disk_type', 'status',
-        'owner_pool_id']
+        'owner_pool_id', 'role']
 
     VOL_KEY_LIST = [
         'id', 'vpd83', 'name', 'total_space', 'consumed_size',
@@ -1762,12 +1762,17 @@ class SimArray(object):
 
     @staticmethod
     def _sim_disk_2_lsm(sim_disk):
+        print sim_disk.items()
+        disk_status = Disk.STATUS_OK
+        if sim_disk['role'] is None:
+            disk_status |= Disk.STATUS_FREE
+
         return Disk(
             SimArray._sim_id_to_lsm_id(sim_disk['id'], 'DISK'),
             sim_disk['name'],
             sim_disk['disk_type'], BackStore.BLK_SIZE,
             int(sim_disk['total_space'] / BackStore.BLK_SIZE),
-            Disk.STATUS_OK, BackStore.SYS_ID)
+            disk_status, BackStore.SYS_ID)
 
     @_handle_errors
     def disks(self):
-- 
1.8.3.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Libstoragemgmt-devel mailing list
Libstoragemgmt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libstoragemgmt-devel

Reply via email to