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
parent 722345cf93
commit db6d958934
No known key found for this signature in database
GPG key ID: E1AAD3D4444A3DA0
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")
}