Merge pull request #1167 in YUNIONIO/onecloud from ~TANGBIN/onecloud:feature/tb-add-sku-list-query-condition to release/2.7.0

* commit '9b5ca1f5a8f975372c6f890026c20aa29dc7a9fd':
  skus query bugfix
This commit is contained in:
邱剑
2019-03-05 17:28:51 +08:00
+5 -3
View File
@@ -184,10 +184,12 @@ func getNameAndExtId(resId string, manager db.IModelManager) (string, string, er
}
_extId := ""
if m, ok := imodel.(*db.SStandaloneResourceBase); ok {
_extId = m.ExternalId
if region, ok := imodel.(*SCloudregion); ok {
_extId = region.ExternalId
} else if zone, ok := imodel.(*SZone); ok {
_extId = zone.ExternalId
} else {
return "", "", fmt.Errorf("res %s is not a standalone resource", resId)
return "", "", fmt.Errorf("res %s not a region/zone resource", resId)
}
segs = strings.Split(_extId, "/")