Skip to content

Commit

Permalink
fix(GetTargetId): Retrieve id by type, such as iscsi, fc, etc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Skazinski <[email protected]>
  • Loading branch information
jskazinski committed Nov 22, 2021
1 parent c70301f commit 5c8772b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,14 @@ func (system *SystemInfo) GetPoolType(pool string) (string, error) {
}

// GetTargetId: Return the target id value for this storage system
func (system *SystemInfo) GetTargetId() (string, error) {
func (system *SystemInfo) GetTargetId(portType string) (string, error) {
if system == nil {
return "", fmt.Errorf("system pointer is nil")
}

for _, p := range system.Ports {
if p.TargetId != "" {
klog.V(2).Infof("++ TargetId (%s) for (%s)\n", p.TargetId, system.IPAddress)
if p.Type == portType && p.TargetId != "" {
klog.V(2).Infof("++ TargetId (%s) for (%s) type (%s)\n", p.TargetId, system.IPAddress, p.Type)
return p.TargetId, nil
}
}
Expand Down

0 comments on commit 5c8772b

Please sign in to comment.