Skip to content

Commit 529d7db

Browse files
committed
fix some fc-hba are missing the statistics/*
Signed-off-by: jiajian.chi <[email protected]>
1 parent a49c6d2 commit 529d7db

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sysfs/class_fibrechannel.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ func parseFibreChannelStatistics(hostPath string) (*FibreChannelCounters, error)
153153
var counters FibreChannelCounters
154154

155155
path := filepath.Join(hostPath, "statistics")
156+
157+
if _, err := os.Stat(path); os.IsNotExist(err) {
158+
fmt.Printf("Directory %s does not exist, skipping.\n", path)
159+
return &counters, nil
160+
}
161+
156162
files, err := os.ReadDir(path)
157163
if err != nil {
158164
return nil, err

0 commit comments

Comments
 (0)