fix: move BMC credentials getter that logs to util func

This commit is contained in:
Devon Bautista 2025-04-16 22:42:19 -06:00 committed by David Allen
parent 939be12da7
commit 5d9afebcb1
Signed by: towk
GPG key ID: 0430CDBE22619155
5 changed files with 97 additions and 69 deletions

View file

@ -141,8 +141,8 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams) ([]map[strin
}
// get BMC username to send
bmcCreds, err := bmc.GetBMCCredentials(params.SecretStore, config.URI)
if err != nil {
bmcCreds := bmc.GetBMCCredentialsOrDefault(params.SecretStore, config.URI)
if bmcCreds == (bmc.BMCCredentials{}) {
log.Error().Str("id", config.URI).Msg("username will be blank")
}