Merge pull request #2311 from ioito/hotfix/qx-zstack-sku

fix: avoid duplicate sku error
This commit is contained in:
yunion-ci-robot
2019-08-16 17:11:06 +08:00
committed by GitHub
+2 -5
View File
@@ -50,13 +50,10 @@ func (region *SRegion) GetInstanceOfferingByType(instanceType string) (*SInstanc
if err != nil {
return nil, err
}
if len(offerings) == 1 {
if len(offerings) >= 1 {
return &offerings[0], nil
}
if len(offerings) == 0 {
return nil, cloudprovider.ErrNotFound
}
return nil, fmt.Errorf("duplicate instanceType %s", instanceType)
return nil, cloudprovider.ErrNotFound
}
func (region *SRegion) CreateISku(sku *cloudprovider.SServerSku) (cloudprovider.ICloudSku, error) {