mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[xenserver] added missing host_cpus attribute to Host model
This commit is contained in:
parent
e98dbf7f68
commit
905ff04e6d
1 changed files with 12 additions and 1 deletions
|
@ -22,6 +22,7 @@ module Fog
|
|||
attribute :__pbds, :aliases => :PBDs
|
||||
attribute :__pifs, :aliases => :PIFs
|
||||
attribute :__resident_vms, :aliases => :resident_VMs
|
||||
attribute :__host_cpus, :aliases => :host_CPUs
|
||||
|
||||
def pifs
|
||||
__pifs.collect { |pif| service.pifs.get pif }
|
||||
|
@ -39,6 +40,16 @@ module Fog
|
|||
resident_servers
|
||||
end
|
||||
|
||||
def host_cpus
|
||||
cpus = []
|
||||
(__host_cpus || []).each do |ref|
|
||||
cpu_ref = connection.get_record(ref, 'host_cpu' )
|
||||
cpu_ref[:connection] = connection
|
||||
cpus << Fog::Compute::XenServer::HostCpu.new(cpu_ref)
|
||||
end
|
||||
cpus
|
||||
end
|
||||
|
||||
def metrics
|
||||
return nil unless __metrics
|
||||
rec = service.get_record(__metrics, 'host_metrics' )
|
||||
|
|
Loading…
Reference in a new issue