Fix KeyError for iSCSI parameters (#67463)
The required parameters for the LUN mapping for destination LUN is address, port and iqn. However if the user doesn't pass parameters like CHAP authentication parameters, we will get KeyError. The patch fixes the same.
This commit is contained in:
parent
0f56ac018b
commit
214bf8dc0b
1 changed files with 7 additions and 7 deletions
|
@ -2207,13 +2207,13 @@ def _get_lun_mappings(module):
|
|||
['iscsi', 'fcp']) else None,
|
||||
logical_units=[
|
||||
otypes.LogicalUnit(
|
||||
id=lunMapping['dest_logical_unit_id'],
|
||||
port=lunMapping['dest_logical_unit_port'],
|
||||
portal=lunMapping['dest_logical_unit_portal'],
|
||||
address=lunMapping['dest_logical_unit_address'],
|
||||
target=lunMapping['dest_logical_unit_target'],
|
||||
password=lunMapping['dest_logical_unit_password'],
|
||||
username=lunMapping['dest_logical_unit_username'],
|
||||
id=lunMapping.get('dest_logical_unit_id'),
|
||||
port=lunMapping.get('dest_logical_unit_port'),
|
||||
portal=lunMapping.get('dest_logical_unit_portal'),
|
||||
address=lunMapping.get('dest_logical_unit_address'),
|
||||
target=lunMapping.get('dest_logical_unit_target'),
|
||||
password=lunMapping.get('dest_logical_unit_password'),
|
||||
username=lunMapping.get('dest_logical_unit_username'),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue