File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -983,6 +983,7 @@ func PublishLUN(
983983 } else if config .SANType == sa .FCP {
984984 // Add wwpns to igroup
985985
986+ var wwpn string
986987 // Get the WWPNs and WWNNs from the host and propagate only the ones which are mapped to SVM
987988 for initiatorPortName , targetPortNames := range publishInfo .HostWWPNMap {
988989 // Format the WWNNs to match the SVM WWNNs
@@ -991,7 +992,7 @@ func PublishLUN(
991992 // Add initiator port name to igroup, if the target port name is mapped to SVM
992993 if nodeName == portNameFormatted {
993994 portName := strings .TrimPrefix (initiatorPortName , "0x" )
994- wwpn : = fcp .ConvertStrToWWNFormat (portName )
995+ wwpn = fcp .ConvertStrToWWNFormat (portName )
995996
996997 err = clientAPI .EnsureIgroupAdded (ctx , igroupName , wwpn )
997998 if err != nil {
@@ -1000,6 +1001,12 @@ func PublishLUN(
10001001 }
10011002 }
10021003 }
1004+
1005+ if wwpn == "" {
1006+ err = fmt .Errorf ("no matching WWPN found for node %v" , nodeName )
1007+ Logc (ctx ).Error (err )
1008+ return err
1009+ }
10031010 }
10041011
10051012 // Map LUN (it may already be mapped)
You can’t perform that action at this time.
0 commit comments