provider/openstack: gophercloud migration: fwaas policy response error handling
This commit is contained in:
parent
c11a4ef214
commit
8f21117fb7
|
@ -186,16 +186,22 @@ func resourceFWPolicyV1Delete(d *schema.ResourceData, meta interface{}) error {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := err.(gophercloud.ErrDefault404); !ok {
|
if _, ok := err.(gophercloud.ErrDefault404); ok {
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// This error usually means that the policy is attached
|
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
|
||||||
// to a firewall. At this point, the firewall is probably
|
if errCode.Actual == 409 {
|
||||||
// being delete. So, we retry a few times.
|
// This error usually means that the policy is attached
|
||||||
|
// to a firewall. At this point, the firewall is probably
|
||||||
|
// being delete. So, we retry a few times.
|
||||||
|
time.Sleep(time.Second * 2)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
time.Sleep(time.Second * 2)
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue