mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: brand of compute quota key should be fixed
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user