mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
fix: added check to stop collect on error
This commit is contained in:
parent
233be46bee
commit
cf1fcc7646
1 changed files with 8 additions and 3 deletions
|
|
@ -133,17 +133,22 @@ func CollectInventory(assets *[]RemoteAsset, params *CollectParams) ([]map[strin
|
|||
// crawl for node and BMC information
|
||||
systems, err = crawler.CrawlBMCForSystems(config)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("failed to crawl BMC for systems")
|
||||
log.Error().Err(err).Str("uri", uri).Msg("failed to crawl BMC for systems")
|
||||
}
|
||||
managers, err = crawler.CrawlBMCForManagers(config)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("failed to crawl BMC for managers")
|
||||
log.Error().Err(err).Str("uri", uri).Msg("failed to crawl BMC for managers")
|
||||
}
|
||||
|
||||
// we didn't find anything so do not proceed
|
||||
if len(systems) == 0 && len(managers) == 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
// get BMC username to send
|
||||
bmcCreds := bmc.GetBMCCredentialsOrDefault(params.SecretStore, config.URI)
|
||||
if bmcCreds == (bmc.BMCCredentials{}) {
|
||||
log.Error().Str("id", config.URI).Msg("username will be blank")
|
||||
log.Warn().Str("id", config.URI).Msg("username will be blank")
|
||||
}
|
||||
|
||||
// data to be sent to smd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue