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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
|
||||||
|
if errCode.Actual == 409 {
|
||||||
// This error usually means that the policy is attached
|
// This error usually means that the policy is attached
|
||||||
// to a firewall. At this point, the firewall is probably
|
// to a firewall. At this point, the firewall is probably
|
||||||
// being delete. So, we retry a few times.
|
// being delete. So, we retry a few times.
|
||||||
|
|
||||||
time.Sleep(time.Second * 2)
|
time.Sleep(time.Second * 2)
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue