fix: brand of compute quota key should be fixed

This commit is contained in:
Qiu Jian
2020-01-08 23:16:44 +08:00
parent 2021c2095a
commit 90c301ca01
15 changed files with 24 additions and 15 deletions
+2 -1
View File
@@ -52,7 +52,8 @@ func (self *SAliyunGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_ALIYUN
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_ALIYUN
keys.Hypervisor = api.HYPERVISOR_ALIYUN
return keys
}
+2 -1
View File
@@ -99,7 +99,8 @@ func (self *SAwsGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, own
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_AWS
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_AWS
keys.Hypervisor = api.HYPERVISOR_AWS
return keys
}
+2 -1
View File
@@ -53,7 +53,8 @@ func (self *SAzureGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, o
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_AZURE
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_AZURE
keys.Hypervisor = api.HYPERVISOR_AZURE
return keys
}
+1 -1
View File
@@ -61,7 +61,7 @@ func (self *SBaremetalGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScop
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_ON_PREMISE
keys.Provider = api.CLOUD_PROVIDER_ONECLOUD
// ignore brand
keys.Brand = api.ONECLOUD_BRAND_ONECLOUD
keys.Hypervisor = api.HYPERVISOR_BAREMETAL
return keys
}
+1
View File
@@ -63,6 +63,7 @@ func (self *SContainerDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, ow
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_ON_PREMISE
keys.Provider = api.CLOUD_PROVIDER_ONECLOUD
keys.Brand = api.ONECLOUD_BRAND_ONECLOUD
keys.Hypervisor = api.HYPERVISOR_CONTAINER
return keys
}
+2 -1
View File
@@ -44,7 +44,8 @@ func (self *SCtyunGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, o
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_CTYUN
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_CTYUN
keys.Hypervisor = api.HYPERVISOR_CTYUN
return keys
}
+2 -2
View File
@@ -65,8 +65,8 @@ func (self *SESXiGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, ow
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_ON_PREMISE
keys.Provider = api.CLOUD_PROVIDER_VMWARE
// ignore brand
// ignore hypervisor keys.Hypervisor = api.HYPERVISOR_ESXI
keys.Brand = api.CLOUD_PROVIDER_VMWARE
keys.Hypervisor = api.HYPERVISOR_ESXI
return keys
}
+2 -1
View File
@@ -36,7 +36,8 @@ func (self *SGoogleGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_GOOGLE
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_GOOGLE
keys.Hypervisor = api.HYPERVISOR_GOOGLE
return keys
}
+2 -1
View File
@@ -50,7 +50,8 @@ func (self *SHuaweiGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_HUAWEI
// ignore brand
keys.Brand = api.CLOUD_PROVIDER_HUAWEI
keys.Hypervisor = api.HYPERVISOR_HUAWEI
return keys
}
+1 -1
View File
@@ -59,7 +59,7 @@ func (self *SKVMGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope, own
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_ON_PREMISE
keys.Provider = api.CLOUD_PROVIDER_ONECLOUD
// ignore brand keys.Brand = brand
keys.Brand = api.ONECLOUD_BRAND_ONECLOUD
keys.Hypervisor = api.HYPERVISOR_KVM
return keys
}
+1
View File
@@ -69,6 +69,7 @@ func (self *SOpenStackGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScop
keys.CloudEnv = api.CLOUD_ENV_PRIVATE_CLOUD
keys.Provider = api.CLOUD_PROVIDER_OPENSTACK
keys.Brand = brand
keys.Hypervisor = api.HYPERVISOR_OPENSTACK
return keys
}
+2 -2
View File
@@ -52,8 +52,8 @@ func (self *SQcloudGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_QCLOUD
// ignore brand keys.Brand = brand
// ignore hypervisor
keys.Brand = api.CLOUD_PROVIDER_QCLOUD
keys.Hypervisor = api.HYPERVISOR_QCLOUD
return keys
}
+2 -2
View File
@@ -44,8 +44,8 @@ func (self *SUCloudGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.SBaseQuotaKeys = quotas.OwnerIdQuotaKeys(scope, ownerId)
keys.CloudEnv = api.CLOUD_ENV_PUBLIC_CLOUD
keys.Provider = api.CLOUD_PROVIDER_UCLOUD
// ignore brand
// ignore hypervisor
keys.Brand = api.CLOUD_PROVIDER_UCLOUD
keys.Hypervisor = api.HYPERVISOR_UCLOUD
return keys
}
+1 -1
View File
@@ -62,7 +62,7 @@ func (self *SZStackGuestDriver) GetComputeQuotaKeys(scope rbacutils.TRbacScope,
keys.CloudEnv = api.CLOUD_ENV_PRIVATE_CLOUD
keys.Provider = api.CLOUD_PROVIDER_ZSTACK
keys.Brand = brand
// ignore hypervisor
keys.Hypervisor = api.HYPERVISOR_ZSTACK
return keys
}
+1
View File
@@ -2943,6 +2943,7 @@ func (self *SGuest) PerformCreateEip(ctx context.Context, userCred mcclient.Toke
eip, err := ElasticipManager.NewEipForVMOnHost(ctx, userCred, self, host, int(bw), chargeType, eipPendingUsage)
if err != nil {
quotas.CancelPendingUsage(ctx, userCred, eipPendingUsage, eipPendingUsage)
return nil, httperrors.NewGeneralError(err)
}