mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
chore: updated error/warn messages to be more informative
This commit is contained in:
parent
3074e7323a
commit
ee99d6e06d
2 changed files with 8 additions and 3 deletions
|
|
@ -99,15 +99,17 @@ var CollectCmd = &cobra.Command{
|
|||
// if we have CLI flags set, then we want to override default stored creds
|
||||
if username != "" && password != "" {
|
||||
// finally, use the CLI arguments passed instead
|
||||
log.Info().Msg("...using provided arguments for credentials")
|
||||
store = secrets.NewStaticStore(username, password)
|
||||
} else {
|
||||
// try and get a default *stored* username/password
|
||||
secret, err := store.GetSecretByID("default")
|
||||
secret, err := store.GetSecretByID(secrets.DEFAULT_KEY)
|
||||
if err != nil {
|
||||
// no default found, so use CLI arguments
|
||||
log.Warn().Err(err).Msg("no default credentials found")
|
||||
log.Warn().Err(err).Msg("failed to get default credentials...")
|
||||
} else {
|
||||
// found default values in local store so use them
|
||||
log.Info().Msg("...using default store for credentials")
|
||||
var creds crawler.BMCUsernamePassword
|
||||
err = json.Unmarshal([]byte(secret), &creds)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue