Sha256: 5b805dd82ed2a51bcc577a124dabdddb595a53fea89060f33a1d1c911c2bcd1b

Contents?: true

Size: 1021 Bytes

Versions: 21

Compression:

Stored size: 1021 Bytes

Contents

module Fog
  module Compute
    class Libvirt
      class Real
        def get_node_info
          node_hash = Hash.new
          node_info = client.node_get_info
          [:model, :memory, :cpus, :mhz, :nodes, :sockets, :cores, :threads].each do |param|
            node_hash[param] = node_info.send(param) rescue nil
          end
          [:type, :version, :node_free_memory, :max_vcpus].each do |param|
            node_hash[param] = client.send(param) rescue nil
          end
          node_hash[:uri] = client.uri
          xml = client.sys_info rescue nil
          [:uuid, :manufacturer, :product, :serial].each do |attr|
            node_hash[attr] = node_attr(attr, xml)
          end if xml

          node_hash[:hostname] = client.hostname
          [node_hash]
        end

        private

        def node_attr attr, xml
          xml_element(xml, "sysinfo/system/entry[@name='#{attr}']").strip
        end

      end

      class Mock
        def get_node_info

        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 10 rubygems

Version Path
hpfog-0.0.20 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-nirvanix-1.8.2 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-nirvanix-1.8.1 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-parser-fix-1.6.1 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-test-again-1.6.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-parser-fix-1.6.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.10.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.9.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-maestrodev-1.8.0.20130114204828 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-maestrodev-1.8.0.20130111070250 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-maestrodev-1.8.0.20130109172219 lib/fog/libvirt/requests/compute/get_node_info.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/libvirt/requests/compute/get_node_info.rb
fog-sgonyea-1.8.1 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.8.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.7.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.6.0 lib/fog/libvirt/requests/compute/get_node_info.rb
fog-1.5.0 lib/fog/libvirt/requests/compute/get_node_info.rb
rackspace-fog-1.4.2 lib/rackspace-fog/libvirt/requests/compute/get_node_info.rb
fog-1.4.0 lib/fog/libvirt/requests/compute/get_node_info.rb