mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
Merge pull request #7801 from wanyaoqi/automated-cherry-pick-of-#7798-upstream-release-3.2
Automated cherry pick of #7798: guest short desc add backup host id
This commit is contained in:
@@ -4220,6 +4220,14 @@ func (self *SGuest) GetShortDesc(ctx context.Context) *jsonutils.JSONDict {
|
||||
billingInfo.SCloudProviderInfo = host.getCloudProviderInfo()
|
||||
}
|
||||
|
||||
if len(self.BackupHostId) > 0 {
|
||||
backupHost := HostManager.FetchHostById(self.BackupHostId)
|
||||
if backupHost != nil {
|
||||
desc.Set("backup_host", jsonutils.NewString(backupHost.Name))
|
||||
desc.Set("backup_host_id", jsonutils.NewString(backupHost.Id))
|
||||
}
|
||||
}
|
||||
|
||||
if priceKey := self.GetMetadata("ext:price_key", nil); len(priceKey) > 0 {
|
||||
billingInfo.PriceKey = priceKey
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user