remove temp code

This commit is contained in:
wanyaoqi
2018-08-24 22:41:24 +08:00
parent 5de6220a74
commit d113017c33
2 changed files with 0 additions and 56 deletions
-25
View File
@@ -3095,31 +3095,6 @@ func (self *SGuest) GetTemplateId() string {
return ""
}
// def get_short_desc(self, user_cred=None):
// desc = super(Guests, self).get_short_desc()
// desc['mem'] = self.vmem_size
// desc['cpu'] = self.vcpu_count
// template_id = self.get_template_id()
// if template_id is not None:
// desc['template_id'] = template_id
// ext_bw, int_bw = self.get_bandwidth()
// if ext_bw > 0:
// desc['ext_bandwidth'] = ext_bw
// if int_bw > 0:
// desc['int_bandwidth'] = int_bw
// hypervisor = self.get_hypervisor()
// desc['hypervisor'] = hypervisor
// spec = self.get_spec(user_cred, status_check=False)
// if hypervisor == self.HYPERVISOR_BAREMETAL:
// host = self.get_host()
// if host is not None:
// host_spec = '/'.join(host.get_spec_ident(
// host.get_spec(user_cred, status_check=False)))
// spec['host_spec'] = host_spec
// if spec is not None:
// desc.update(spec)
// return desc
func (self *SGuest) GetShortDesc() *jsonutils.JSONDict {
desc := self.SStandaloneResourceBase.GetShortDesc()
desc.Set("mem", jsonutils.NewInt(int64(self.VmemSize)))
-31
View File
@@ -506,37 +506,6 @@ func (self *SHost) ClearSchedDescCache() error {
return HostManager.ClearSchedDescCache(self.Id)
}
// def get_spec(self, user_cred, status_check=True, **kwargs):
// if status_check:
// if self.status in [baremetalstatus.INIT, baremetalstatus.PREPARE_FAIL,
// baremetalstatus.PREPARE] or \
// self.get_baremetal_server() is not None:
// return None
// if self.mem_size is None or self.cpu_count is None:
// return None
// from clouds.baremetal import nictypes
// spec = self.get_hardware_specification()
// spec.pop('storage_info', None)
// net_info = []
// for netif in self.get_netifs():
// net_desc = netif.get_baremetal_json_desc()
// if net_desc.get('nic_type', None) != nictypes.NIC_TYPE_IPMI:
// net_info.append(net_desc)
// spec['nic_count'] = len(net_info)
// spec['manufacture'] = self.sys_info.get('manufacture', 'Unknown')
// spec['model'] = self.sys_info.get('model', 'Unknown')
// return spec
// def get_hardware_specification(self):
// spec = {}
// spec['cpu'] = self.cpu_count
// spec['mem'] = self.mem_size
// if self.storage_info:
// from clouds.baremetal import diskconfig
// spec['disk'] = diskconfig.get_disk_spec_v2(self.storage_info)
// spec['driver'] = self.storage_driver
// spec['storage_info'] = self.storage_info
// return spec
func (self *SHost) GetSpec(statusCheck bool) *jsonutils.JSONDict {
if statusCheck {
if utils.IsInStringArray(self.Status, []string{BAREMETAL_INIT, BAREMETAL_PREPARE_FAIL, BAREMETAL_PREPARE}) ||