Don't error if unable to undeploy
This commit is contained in:
parent
a02667389e
commit
aec94b1682
|
@ -315,13 +315,11 @@ func resourceVcdVAppDelete(d *schema.ResourceData, meta interface{}) error {
|
||||||
return fmt.Errorf("error finding vapp: %s", err)
|
return fmt.Errorf("error finding vapp: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
status, err := vapp.GetStatus()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error getting VApp status: %#v", err)
|
return fmt.Errorf("Error getting VApp status: %#v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if status == "POWERED_ON" {
|
_ = retryCall(vcdClient.MaxRetryTimeout, func() error {
|
||||||
err = retryCall(vcdClient.MaxRetryTimeout, func() error {
|
|
||||||
task, err := vapp.Undeploy()
|
task, err := vapp.Undeploy()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("Error undeploying: %#v", err)
|
return fmt.Errorf("Error undeploying: %#v", err)
|
||||||
|
@ -329,10 +327,6 @@ func resourceVcdVAppDelete(d *schema.ResourceData, meta interface{}) error {
|
||||||
|
|
||||||
return task.WaitTaskCompletion()
|
return task.WaitTaskCompletion()
|
||||||
})
|
})
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
err = retryCall(vcdClient.MaxRetryTimeout, func() error {
|
err = retryCall(vcdClient.MaxRetryTimeout, func() error {
|
||||||
task, err := vapp.Delete()
|
task, err := vapp.Delete()
|
||||||
|
|
Loading…
Reference in New Issue