Skip to content

Commit 9e41f3e

Browse files
committed
fix(cinder): avoid failing if initiator field is missing on connection
1 parent a22a2d1 commit 9e41f3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

python/cinder-understack/cinder_understack/dynamic_netapp_driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,8 @@ def initialize_connection(self, volume, connector):
412412
"""Initialize connection to volume."""
413413
# TODO: the nova ironic driver sends the field 'initiator' but the NetApp
414414
# cinder driver expects the field to be 'nqn' so copy the field over
415-
connector["nqn"] = connector["initiator"]
415+
if "initiator" in connector and "nqn" not in connector:
416+
connector["nqn"] = connector["initiator"]
416417
with self._volume_to_library(volume) as lib:
417418
return lib.initialize_connection(volume, connector)
418419

0 commit comments

Comments
 (0)