Merge pull request #7415 from programmer04/improve-name-conflict-msg

fix 7403: Improve error message for conflicting images name
This commit is contained in:
Megan Marsh 2019-03-15 16:01:41 -07:00 committed by GitHub
commit d505bc59a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ func (s *stepPreValidate) Run(_ context.Context, state multistep.StateBag) multi
} }
if len(images) > 0 { if len(images) > 0 {
err := fmt.Errorf("Error: name conflicts with an existing alicloud image: %s", images[0].ImageId) err := fmt.Errorf("Error: Image Name: '%s' is used by an existing alicloud image: %s", images[0].ImageName, images[0].ImageId)
state.Put("error", err) state.Put("error", err)
ui.Error(err.Error()) ui.Error(err.Error())
return multistep.ActionHalt return multistep.ActionHalt

View File

@ -90,7 +90,7 @@ func (s *StepPreValidate) Run(_ context.Context, state multistep.StateBag) multi
} }
if len(resp.Images) > 0 { if len(resp.Images) > 0 {
err := fmt.Errorf("Error: name conflicts with an existing AMI: %s", *resp.Images[0].ImageId) err := fmt.Errorf("Error: AMI Name: '%s' is used by an existing AMI: %s", *resp.Images[0].Name, *resp.Images[0].ImageId)
state.Put("error", err) state.Put("error", err)
ui.Error(err.Error()) ui.Error(err.Error())
return multistep.ActionHalt return multistep.ActionHalt