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:
yunion-ci-robot
2020-09-07 21:01:51 +08:00
committed by GitHub
+8
View File
@@ -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
}