Skip to content

Commit 323b105

Browse files
Fix issue with dataLIF query for FCP interfaces with ZAPI.
1 parent 6941b07 commit 323b105

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

storage_drivers/ontap/api/ontap_zapi.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2984,26 +2984,22 @@ func (c Client) NetInterfaceGetDataLIFs(ctx context.Context, protocol string) ([
29842984
return dataLIFs, nil
29852985
}
29862986

2987-
func (c Client) NetFcpInterfaceGet() (*azgo.FcpInterfaceGetIterResponse, error) {
2988-
response, err := azgo.NewFcpInterfaceGetIterRequest().
2989-
SetMaxRecords(DefaultZapiRecords).
2990-
SetQuery(azgo.FcpInterfaceGetIterRequestQuery{
2991-
FcpInterfaceInfoPtr: &azgo.FcpInterfaceInfoType{},
2992-
}).ExecuteUsing(c.zr)
2993-
2994-
return response, err
2995-
}
2996-
29972987
func (c Client) NetFcpInterfaceGetDataLIFs(ctx context.Context, protocol string) ([]string, error) {
2998-
lifResponse, err := c.NetFcpInterfaceGet()
2988+
lifResponse, err := c.NetInterfaceGet()
29992989
if err = azgo.GetError(ctx, lifResponse, err); err != nil {
30002990
return nil, fmt.Errorf("error checking network interfaces: %v", err)
30012991
}
30022992

30032993
dataLIFs := make([]string, 0)
30042994
if lifResponse.Result.AttributesListPtr != nil {
3005-
for _, attrs := range lifResponse.Result.AttributesListPtr.FcpInterfaceInfoPtr {
3006-
dataLIFs = append(dataLIFs, attrs.PortName())
2995+
for _, attrs := range lifResponse.Result.AttributesListPtr.NetInterfaceInfoPtr {
2996+
if attrs.OperationalStatus() == LifOperationalStatusUp {
2997+
for _, proto := range attrs.DataProtocols().DataProtocolPtr {
2998+
if proto == protocol {
2999+
dataLIFs = append(dataLIFs, attrs.Wwpn())
3000+
}
3001+
}
3002+
}
30073003
}
30083004
}
30093005

0 commit comments

Comments
 (0)