Commit 3de57084 authored by FengyunPan2's avatar FengyunPan2 Committed by Cédric de Saint Martin

IsNotFound should check ErrDefault404 and ErrUnexpectedResponseCode

Related to: #60658 #60976 Refer to: https://github.com/gophercloud/gophercloud/pull/103
parent 18f4924f
...@@ -608,8 +608,17 @@ func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) { ...@@ -608,8 +608,17 @@ func (os *OpenStack) LoadBalancer() (cloudprovider.LoadBalancer, bool) {
} }
func isNotFound(err error) bool { func isNotFound(err error) bool {
e, ok := err.(*gophercloud.ErrUnexpectedResponseCode) if _, ok := err.(gophercloud.ErrDefault404); ok {
return ok && e.Actual == http.StatusNotFound return true
}
if errCode, ok := err.(gophercloud.ErrUnexpectedResponseCode); ok {
if errCode.Actual == http.StatusNotFound {
return true
}
}
return false
} }
// Zones indicates that we support zones // Zones indicates that we support zones
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment