mirror of
https://github.com/hashicorp/packer.git
synced 2026-09-26 09:44:01 -04:00
Merge pull request #1917 from sequenceiq/atlas-postprocessor-auth-failure-hint
Clarify error message in case of an atlas client connection failure
This commit is contained in:
@@ -115,7 +115,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
p.client, err = atlas.NewClient(p.config.ServerAddr)
|
||||
if err != nil {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error initializing client: %s", err))
|
||||
errs, fmt.Errorf("Error initializing atlas client: %s", err))
|
||||
return errs
|
||||
}
|
||||
}
|
||||
@@ -126,8 +126,13 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
|
||||
if !p.config.Test {
|
||||
// Verify the client
|
||||
if err := p.client.Verify(); err != nil {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error initializing client: %s", err))
|
||||
if err == atlas.ErrAuth {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error connecting to atlas server, please check your ATLAS_TOKEN env: %s", err))
|
||||
} else {
|
||||
errs = packer.MultiErrorAppend(
|
||||
errs, fmt.Errorf("Error initializing atlas client: %s", err))
|
||||
}
|
||||
return errs
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user