Blame SOURCES/libstoragemgmt-1.2.3-megaraid-fixes.patch

4797fc
diff --git plugin/megaraid/megaraid.py plugin/megaraid/megaraid.py
4797fc
index d921c8e..3a41c78 100644
4797fc
--- plugin/megaraid/megaraid.py
4797fc
+++ plugin/megaraid/megaraid.py
4797fc
@@ -473,6 +473,8 @@ def pools(self, search_key=None, search_value=None,
4797fc
             dg_show_output = self._storcli_exec(
4797fc
                 ["/c%d/dall" % ctrl_num, "show", "all"])
4797fc
             free_space_list = dg_show_output.get('FREE SPACE DETAILS', [])
4797fc
+            if 'TOPOLOGY' not in dg_show_output:
4797fc
+                continue
4797fc
             for dg_top in dg_show_output['TOPOLOGY']:
4797fc
                 if dg_top['Arr'] != '-':
4797fc
                     continue
4797fc
@@ -490,6 +492,9 @@ def _vd_to_lsm_vol(vd_id, dg_id, sys_id, vd_basic_info, vd_pd_info_list,
4797fc
 
4797fc
         vol_id = "%s:VD%d" % (sys_id, vd_id)
4797fc
         name = "VD %d" % vd_id
4797fc
+        if 'Name' in vd_basic_info.keys() and vd_basic_info['Name']:
4797fc
+            name += ": %s" % vd_basic_info['Name']
4797fc
+
4797fc
         vpd83 = ''  # TODO(Gris Ge): Beg LSI to provide this information.
4797fc
         block_size = size_human_2_size_bytes(vd_pd_info_list[0]['SeSz'])
4797fc
         num_of_blocks = vd_prop_info['Number of Blocks']
4797fc
@@ -700,19 +705,23 @@ def volume_raid_create(self, name, raid_type, disks, strip_size,
4797fc
             (cur_ctrl_num, cur_enclosure_num, slot_num) = \
4797fc
                 disk.plugin_data.split(':')
4797fc
 
4797fc
-            if ctrl_num and cur_ctrl_num != ctrl_num:
4797fc
+            cur_ctrl_num = int(cur_ctrl_num)
4797fc
+            cur_enclosure_num = int(cur_enclosure_num)
4797fc
+
4797fc
+            if ctrl_num is not None and cur_ctrl_num != ctrl_num:
4797fc
                 raise LsmError(
4797fc
                     ErrorNumber.INVALID_ARGUMENT,
4797fc
                     "Illegal input disks argument: disks are not from the "
4797fc
                     "same controller/system.")
4797fc
 
4797fc
-            if enclosure_num and cur_enclosure_num != enclosure_num:
4797fc
+            if enclosure_num is not None and \
4797fc
+               cur_enclosure_num != enclosure_num:
4797fc
                 raise LsmError(
4797fc
                     ErrorNumber.INVALID_ARGUMENT,
4797fc
                     "Illegal input disks argument: disks are not from the "
4797fc
                     "same disk enclosure.")
4797fc
 
4797fc
-            ctrl_num = int(cur_ctrl_num)
4797fc
+            ctrl_num = cur_ctrl_num
4797fc
             enclosure_num = cur_enclosure_num
4797fc
             slot_nums.append(slot_num)
4797fc
 
4797fc
@@ -722,7 +731,7 @@ def volume_raid_create(self, name, raid_type, disks, strip_size,
4797fc
         cmds = [
4797fc
             "/c%s" % ctrl_num, "add", "vd", mega_raid_type,
4797fc
             'size=all', "name=%s" % name,
4797fc
-            "drives=%s:%s" % (enclosure_num, ','.join(slot_nums))]
4797fc
+            "drives=%d:%s" % (enclosure_num, ','.join(slot_nums))]
4797fc
 
4797fc
         if raid_type == Volume.RAID_TYPE_RAID10 or \
4797fc
            raid_type == Volume.RAID_TYPE_RAID50 or \