Fix unreachable code
This commit is contained in:
parent
6f545af7f7
commit
4605f9559f
|
@ -19,14 +19,15 @@ func (s *StepCheckExistingImage) Run(state multistep.StateBag) multistep.StepAct
|
|||
|
||||
if !c.PackerForce {
|
||||
ui.Say("Checking image does not exist...")
|
||||
c.imageAlreadyExists = d.ImageExists(c.ImageName)
|
||||
if c.imageAlreadyExists {
|
||||
err := fmt.Errorf("Image %s already exists.\n"+
|
||||
"Use the force flag to delete it prior to building.", c.ImageName)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
}
|
||||
|
||||
c.imageAlreadyExists = d.ImageExists(c.ImageName)
|
||||
if !c.PackerForce && c.imageAlreadyExists {
|
||||
err := fmt.Errorf("Image %s already exists.\n"+
|
||||
"Use the force flag to delete it prior to building.", c.ImageName)
|
||||
state.Put("error", err)
|
||||
ui.Error(err.Error())
|
||||
return multistep.ActionHalt
|
||||
}
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue