mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-06-23 04:15:16 +08:00
fix: deprecated-by => yunion:deprecated-by
This commit is contained in:
@@ -297,7 +297,7 @@ func (self *SCloudaccount) ValidateUpdateData(
|
||||
input.Options = optionsJson
|
||||
}
|
||||
|
||||
if len(input.ProxySettingId) > 0 {
|
||||
if len(input.ProxySetting) > 0 {
|
||||
var proxySetting *proxy.SProxySetting
|
||||
proxySetting, input.ProxySettingResourceInput, err = proxy.ValidateProxySettingResourceInput(userCred, input.ProxySettingResourceInput)
|
||||
if err != nil {
|
||||
@@ -391,8 +391,8 @@ func (manager *SCloudaccountManager) ValidateCreateData(
|
||||
|
||||
var proxyFunc httputils.TransportProxyFunc
|
||||
{
|
||||
if input.ProxySettingId == "" {
|
||||
input.ProxySettingId = proxyapi.ProxySettingId_DIRECT
|
||||
if input.ProxySetting == "" {
|
||||
input.ProxySetting = proxyapi.ProxySettingId_DIRECT
|
||||
}
|
||||
var proxySetting *proxy.SProxySetting
|
||||
proxySetting, input.ProxySettingResourceInput, err = proxy.ValidateProxySettingResourceInput(userCred, input.ProxySettingResourceInput)
|
||||
|
||||
@@ -366,8 +366,8 @@ func (gt *SGuestTemplate) getMoreDetails(ctx context.Context, userCred mcclient.
|
||||
configInfo.Disks = disks
|
||||
|
||||
// keypair
|
||||
if len(input.KeypairId) > 0 {
|
||||
model, err := KeypairManager.FetchById(input.KeypairId)
|
||||
if len(input.Keypair) > 0 {
|
||||
model, err := KeypairManager.FetchByIdOrName(userCred, input.Keypair)
|
||||
if err == nil {
|
||||
keypair := model.(*SKeypair)
|
||||
configInfo.Keypair = keypair.GetName()
|
||||
@@ -482,7 +482,7 @@ func (gt *SGuestTemplate) PerformPublic(
|
||||
|
||||
// check for below private resource in the guest template
|
||||
privateResource := map[string]int{
|
||||
"keypair": len(input.KeypairId),
|
||||
"keypair": len(input.Keypair),
|
||||
"instance group": len(input.InstanceGroupIds),
|
||||
"instance snapshot": len(input.InstanceSnapshotId),
|
||||
}
|
||||
|
||||
@@ -1272,13 +1272,13 @@ func (manager *SGuestManager) validateCreateData(
|
||||
input.IsolatedDevices[idx] = devConfig
|
||||
}
|
||||
|
||||
keypairId := input.KeypairId
|
||||
keypairId := input.Keypair
|
||||
if len(keypairId) > 0 {
|
||||
keypairObj, err := KeypairManager.FetchByIdOrName(userCred, keypairId)
|
||||
if err != nil {
|
||||
return nil, httperrors.NewResourceNotFoundError("Keypair %s not found", keypairId)
|
||||
}
|
||||
input.KeypairId = keypairObj.GetId()
|
||||
input.Keypair = keypairObj.GetId()
|
||||
}
|
||||
|
||||
secGrpIds := []string{}
|
||||
@@ -4880,7 +4880,7 @@ func (self *SGuest) ToCreateInput(userCred mcclient.TokenCredential) *api.Server
|
||||
userInput.ShutdownBehavior = genInput.ShutdownBehavior
|
||||
userInput.IsSystem = genInput.IsSystem
|
||||
userInput.SecgroupId = genInput.SecgroupId
|
||||
userInput.KeypairId = genInput.KeypairId
|
||||
userInput.Keypair = genInput.Keypair
|
||||
userInput.EipBw = genInput.EipBw
|
||||
userInput.EipChargeType = genInput.EipChargeType
|
||||
// cloned server should belongs to the project creating it
|
||||
@@ -4942,7 +4942,7 @@ func (self *SGuest) toCreateInput() *api.ServerCreateInput {
|
||||
r.IsolatedDevices = self.ToIsolatedDevicesConfig()
|
||||
|
||||
if keypair := self.getKeypair(); keypair != nil {
|
||||
r.KeypairId = keypair.Id
|
||||
r.Keypair = keypair.Id
|
||||
}
|
||||
if host := self.GetHost(); host != nil {
|
||||
r.ResourceType = host.ResourceType
|
||||
|
||||
@@ -315,7 +315,7 @@ func (self *SInstanceSnapshot) ToInstanceCreateInput(
|
||||
sourceInput.VcpuCount = serverConfig.Ncpu
|
||||
}
|
||||
if len(self.KeypairId) > 0 {
|
||||
sourceInput.KeypairId = self.KeypairId
|
||||
sourceInput.Keypair = self.KeypairId
|
||||
}
|
||||
if self.SecGroups != nil {
|
||||
secGroups := make([]string, 0)
|
||||
|
||||
Reference in New Issue
Block a user