Fixi iscsi register backport (#67542)

* 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.

* add changelog

Co-authored-by: Nijin Ashok <nashok@redhat.com>
pull/67986/head
Martin Nečas 5 years ago committed by GitHub
parent 151d83efc3
commit 9351cbfde3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- "ovirt_vm: correct keyError for iSCSI parameters"

@ -2166,13 +2166,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…
Cancel
Save