* The 'flags' argument of query methods is now a bitmap. We change plugin
   to use '&' instead of '=='.
 * Sync plugins with FLAG_RETRIEVE_FULL_INFO changes.

Signed-off-by: Gris Ge <f...@redhat.com>
---
 plugin/ontap/ontap.py  |  8 ++++----
 plugin/sim/simarray.py | 10 +++++-----
 plugin/smispy/smis.py  | 12 ++++++------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/plugin/ontap/ontap.py b/plugin/ontap/ontap.py
index d97bfe7..a242668 100644
--- a/plugin/ontap/ontap.py
+++ b/plugin/ontap/ontap.py
@@ -290,7 +290,7 @@ class Ontap(IStorageAreaNetwork, INfs):
     def _disk(self, d, flag):
         opt_data = OptionalData()
         status = Ontap._status_of_na_disk(d)
-        if flag == Disk.RETRIEVE_FULL_INFO:
+        if flag & Disk.FLAG_RETRIEVE_FULL_INFO:
             opt_data.set('sn', d['serial-number'])
             opt_data.set('model', d['disk-model'])
             opt_data.set('vendor', d['vendor-id'])
@@ -358,7 +358,7 @@ class Ontap(IStorageAreaNetwork, INfs):
         system_id = self.sys_info.id
         status = self._status_of_na_aggr(na_aggr)
         opt_data = OptionalData()
-        if flags == Pool.RETRIEVE_FULL_INFO:
+        if flags & Pool.FLAG_RETRIEVE_FULL_INFO:
             opt_data.set('member_type', Pool.MEMBER_TYPE_DISK)
             member_ids = []
             for na_disk in na_disks:
@@ -415,7 +415,7 @@ class Ontap(IStorageAreaNetwork, INfs):
         system_id = self.sys_info.id
         status = self._status_of_na_vol(na_vol)
         opt_data = OptionalData()
-        if flags == Pool.RETRIEVE_FULL_INFO:
+        if flags & Pool.FLAG_RETRIEVE_FULL_INFO:
             opt_data.set('member_type', Pool.MEMBER_TYPE_POOL)
             parent_aggr_name = na_vol['containing-aggregate']
             for na_aggr in na_aggrs:
@@ -502,7 +502,7 @@ class Ontap(IStorageAreaNetwork, INfs):
         na_disks = []
         # We do extra flags check in order to save self.f.disks() calls
         # in case we have multiple aggregates.
-        if flags == Pool.RETRIEVE_FULL_INFO:
+        if flags & Pool.FLAG_RETRIEVE_FULL_INFO:
             na_disks = self.f.disks()
         for na_aggr in na_aggrs:
             pools.extend([self._pool_from_na_aggr(na_aggr, na_disks, flags)])
diff --git a/plugin/sim/simarray.py b/plugin/sim/simarray.py
index f530763..10cfc27 100644
--- a/plugin/sim/simarray.py
+++ b/plugin/sim/simarray.py
@@ -159,7 +159,7 @@ class SimArray(object):
         status_info = sim_pool['status_info']
         sys_id = sim_pool['sys_id']
         opt_data = OptionalData()
-        if flags == Pool.RETRIEVE_FULL_INFO:
+        if flags & Pool.FLAG_RETRIEVE_FULL_INFO:
             opt_data.set('raid_type', sim_pool['raid_type'])
             opt_data.set('member_type', sim_pool['member_type'])
             opt_data.set('member_ids', sim_pool['member_ids'])
@@ -182,28 +182,28 @@ class SimArray(object):
         sim_pool = self.data.pool_create(
             sys_id, pool_name, size_bytes, raid_type, member_type, flags)
         return self.data.job_create(
-            self._sim_pool_2_lsm(sim_pool, Pool.RETRIEVE_FULL_INFO))
+            self._sim_pool_2_lsm(sim_pool, Pool.FLAG_RETRIEVE_FULL_INFO))
 
     def pool_create_from_disks(self, sys_id, pool_name, disks_ids, raid_type,
                                flags=0):
         sim_pool = self.data.pool_create_from_disks(
             sys_id, pool_name, disks_ids, raid_type, flags)
         return self.data.job_create(
-            self._sim_pool_2_lsm(sim_pool, Pool.RETRIEVE_FULL_INFO))
+            self._sim_pool_2_lsm(sim_pool, Pool.FLAG_RETRIEVE_FULL_INFO))
 
     def pool_create_from_volumes(self, sys_id, pool_name, member_ids,
                                  raid_type, flags=0):
         sim_pool = self.data.pool_create_from_volumes(
             sys_id, pool_name, member_ids, raid_type, flags)
         return self.data.job_create(
-            self._sim_pool_2_lsm(sim_pool, Pool.RETRIEVE_FULL_INFO))
+            self._sim_pool_2_lsm(sim_pool, Pool.FLAG_RETRIEVE_FULL_INFO))
 
     def pool_create_from_pool(self, sys_id, pool_name, member_id, size_bytes,
                               flags=0):
         sim_pool = self.data.pool_create_from_pool(
             sys_id, pool_name, member_id, size_bytes, flags)
         return self.data.job_create(
-            self._sim_pool_2_lsm(sim_pool, Pool.RETRIEVE_FULL_INFO))
+            self._sim_pool_2_lsm(sim_pool, Pool.FLAG_RETRIEVE_FULL_INFO))
 
     def pool_delete(self, pool_id, flags=0):
         return self.data.job_create(self.data.pool_delete(pool_id, flags))[0]
diff --git a/plugin/smispy/smis.py b/plugin/smispy/smis.py
index b2da486..42e2749 100644
--- a/plugin/smispy/smis.py
+++ b/plugin/smispy/smis.py
@@ -1494,7 +1494,7 @@ class Smis(IStorageAreaNetwork):
         """
         rc = []
         cim_pool_pros = self._new_pool_cim_pool_pros(
-            flags == Pool.RETRIEVE_FULL_INFO)
+            bool(flags & Pool.FLAG_RETRIEVE_FULL_INFO))
 
         cim_sys_pros = self._property_list_of_id("System")
         cim_syss = self._root_cim_syss(cim_sys_pros)
@@ -1531,7 +1531,7 @@ class Smis(IStorageAreaNetwork):
                 pool = self._new_pool(cim_pool, system_id)
                 if pool:
                     rc.extend([pool])
-                    if flags == Pool.RETRIEVE_FULL_INFO:
+                    if flags & Pool.FLAG_RETRIEVE_FULL_INFO:
                         opt_pro_dict = self._pool_opt_data(cim_pool)
                         for key, value in opt_pro_dict.items():
                             pool.optional_data.set(key, value)
@@ -2332,7 +2332,7 @@ class Smis(IStorageAreaNetwork):
         """
         pros = ['OperationalStatus', 'Name', 'SystemName',
                 'Caption', 'InterconnectType', 'DiskType']
-        if flag == Disk.RETRIEVE_FULL_INFO:
+        if flag & Disk.FLAG_RETRIEVE_FULL_INFO:
             pros.extend(['ErrorDescription', 'ErrorCleared'])
         return pros
 
@@ -2351,8 +2351,8 @@ class Smis(IStorageAreaNetwork):
         object.
         """
         pros = []   # we don't need CIM_PhysicalPackage when not
-                    # RETRIEVE_FULL_INFO
-        if flag == Disk.RETRIEVE_FULL_INFO:
+                    # FLAG_RETRIEVE_FULL_INFO
+        if flag & Disk.FLAG_RETRIEVE_FULL_INFO:
             pros.extend(['SerialNumber', 'PartNumber', 'Manufacturer',
                          'Model'])
         return pros
@@ -2436,7 +2436,7 @@ class Smis(IStorageAreaNetwork):
                         disk_type = Disk.DISK_TYPE_SAS
 
         optionals = OptionalData()
-        if flag_full_info == Disk.RETRIEVE_FULL_INFO:
+        if flag_full_info & Disk.FLAG_RETRIEVE_FULL_INFO:
             opt_pro_dict = {
                 'sn': '',
                 'part_num': '',
-- 
1.8.3.1


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Libstoragemgmt-devel mailing list
Libstoragemgmt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libstoragemgmt-devel

Reply via email to