Merge pull request #15190 from ioito/hotfix/qx-incloudsphere-list

fix(region): incloudsphere list items
This commit is contained in:
Zexi Li
2022-10-14 16:17:57 +08:00
committed by GitHub
+3 -2
View File
@@ -213,14 +213,15 @@ func (cli *SphereClient) list(res string, params url.Values, retVal interface{})
return errors.Wrapf(err, "list(%s)", res)
}
totalSize, _ := resp.Int("totalSize")
array := []jsonutils.JSONObject{}
if resp.Contains("items") {
array, err := resp.GetArray("items")
array, err = resp.GetArray("items")
if err != nil {
return errors.Wrapf(err, "get items")
}
items.Add(array...)
}
if totalSize <= int64(items.Length()) {
if totalSize <= int64(items.Length()) || len(array) == 0 {
break
}
page++