Skip to content

Commit fc8cccf

Browse files
include nil reference check during retires
1 parent fb6d814 commit fc8cccf

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

exporter/helpers.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ func getDIMMEndpoints(url, host string, client *retryablehttp.Client) (oem.Colle
253253
for retryCount < 1 && resp.StatusCode == http.StatusNotFound {
254254
time.Sleep(client.RetryWaitMin)
255255
resp, err = common.DoRequest(client, req)
256+
if err != nil {
257+
return dimms, err
258+
}
256259
retryCount = retryCount + 1
257260
}
258261
if err != nil {
@@ -297,6 +300,9 @@ func getDriveEndpoint(url, host string, client *retryablehttp.Client) (oem.Gener
297300
for retryCount < 3 && resp.StatusCode == http.StatusNotFound {
298301
time.Sleep(client.RetryWaitMin)
299302
resp, err = common.DoRequest(client, req)
303+
if err != nil {
304+
return drive, err
305+
}
300306
retryCount = retryCount + 1
301307
}
302308
if err != nil {
@@ -473,6 +479,9 @@ func getProcessorEndpoints(url, host string, client *retryablehttp.Client) (oem.
473479
for retryCount < 3 && resp.StatusCode == http.StatusNotFound {
474480
time.Sleep(client.RetryWaitMin)
475481
resp, err = common.DoRequest(client, req)
482+
if err != nil {
483+
return processors, err
484+
}
476485
retryCount = retryCount + 1
477486
}
478487
if err != nil {

plugins/nuova/helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ func checkRaidController(url, host string, client *retryablehttp.Client) (bool,
8585
for retryCount < 1 && resp.StatusCode == http.StatusNotFound {
8686
time.Sleep(client.RetryWaitMin)
8787
resp, err = common.DoRequest(client, req)
88+
if err != nil {
89+
return false, nil
90+
}
8891
retryCount = retryCount + 1
8992
}
9093
if err != nil {

0 commit comments

Comments
 (0)