From 2e036c549d359650681e9cd4bf598cd8f6564cb6 Mon Sep 17 00:00:00 2001 From: "David J. Allen" Date: Wed, 21 Aug 2024 16:55:07 -0600 Subject: [PATCH] Rearranged collect error to only show when not force updating --- internal/collect.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/collect.go b/internal/collect.go index 9c123c3..ea7ca69 100644 --- a/internal/collect.go +++ b/internal/collect.go @@ -150,7 +150,6 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams) error { if smdClient.URI != "" { err = smdClient.Add(body, headers) if err != nil { - log.Error().Err(err).Msgf("failed to add Redfish endpoint") // try updating instead if params.ForceUpdate { @@ -159,6 +158,8 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams) error { if err != nil { log.Error().Err(err).Msgf("failed to forcibly update Redfish endpoint") } + } else { + log.Error().Err(err).Msgf("failed to add Redfish endpoint") } } } else {