mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #344 in YUNIONIO/onecloud from ~QIUJIAN/onecloud:hotfix/qj-resolve-conflict-20181022-2.1.0 to release/2.1.0
* commit '05538b68f39c6f06b85b0d84094107f2636d3bb1': fix: server list and details no is_gpu field
This commit is contained in:
@@ -1012,6 +1012,12 @@ func (self *SGuest) GetCustomizeColumns(ctx context.Context, userCred mcclient.T
|
||||
extra.Add(jsonutils.NewString(timeutils.FullIsoTime(pendingDeletedAt)), "auto_delete_at")
|
||||
}
|
||||
|
||||
isGpu := jsonutils.JSONFalse
|
||||
if self.isGpu() {
|
||||
isGpu = jsonutils.JSONTrue
|
||||
}
|
||||
extra.Add(isGpu, "is_gpu")
|
||||
|
||||
return self.moreExtraInfo(extra)
|
||||
}
|
||||
|
||||
@@ -1078,6 +1084,13 @@ func (self *SGuest) GetExtraDetails(ctx context.Context, userCred mcclient.Token
|
||||
extra.Add(jsonutils.NewString(eip.IpAddr), "eip")
|
||||
extra.Add(jsonutils.NewString(eip.Mode), "eip_mode")
|
||||
}
|
||||
|
||||
isGpu := jsonutils.JSONFalse
|
||||
if self.isGpu() {
|
||||
isGpu = jsonutils.JSONTrue
|
||||
}
|
||||
extra.Add(isGpu, "is_gpu")
|
||||
|
||||
return self.moreExtraInfo(extra)
|
||||
}
|
||||
|
||||
@@ -1315,6 +1328,10 @@ func (self *SGuest) getAdminSecurityRules() string {
|
||||
}
|
||||
}
|
||||
|
||||
func (self *SGuest) isGpu() bool {
|
||||
return len(self.GetIsolatedDevices()) != 0
|
||||
}
|
||||
|
||||
func (self *SGuest) GetIsolatedDevices() []SIsolatedDevice {
|
||||
return IsolatedDeviceManager.findAttachedDevicesOfGuest(self)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user