Skip to content

Commit

Permalink
Merge pull request #451 from yuanyu-ghca/hpe_3par_hostmap
Browse files Browse the repository at this point in the history
modify bug
  • Loading branch information
yuanyu-ghca authored Jan 21, 2022
2 parents b739071 + b869067 commit 3f0f900
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions delfin/drivers/hpe/hpe_3par/component_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,13 +629,16 @@ def list_masking_views(self, storage_id):
port = view.get('port', '').replace('-', '')
lun_id = view.get('lun')
wwn = view.get('host_wwn/iscsi_name', '').replace('-', '')
native_port_group_id = None
if port:
lun_id = '%s_%s' % (view.get('lun'), port)
native_port_group_id = 'port_group_%s' % port
if wwn:
lun_id = '%s_%s' % (lun_id, wwn)
view_model = {
'native_masking_view_id': lun_id,
"name": view.get('lun'),
'native_port_group_id': native_port_group_id,
"storage_id": storage_id
}
if 'set:' in vv_name:
Expand All @@ -653,6 +656,9 @@ def list_masking_views(self, storage_id):
else:
host_id = hosts_map.get(host_name)
view_model['native_storage_host_id'] = host_id

views_list.append(view_model)
if (view_model.get('native_storage_host_id')
or view_model.get('native_storage_host_group_id')) \
and (view_model.get('native_volume_id')
or view_model.get('native_volume_group_id')):
views_list.append(view_model)
return views_list
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,7 @@ def __init__(self):
'native_masking_view_id': '2_0:2:1',
'name': '2',
'storage_id': '12345',
'native_port_group_id': 'port_group_0:2:1',
'native_volume_id': '666',
'native_storage_host_id': '160'
}]
Expand Down

0 comments on commit 3f0f900

Please sign in to comment.