Sha256: 31d1782b5b42eea136782dc90cff9f2919571cec95b2c8b1eae4bec5676d7c5f

Contents?: true

Size: 895 Bytes

Versions: 3

Compression:

Stored size: 895 Bytes

Contents

module FogExtensions
  module Xenserver
    module Server
      extend ActiveSupport::Concern


      include ActionView::Helpers::NumberHelper


      attr_accessor :memory_min, :memory_max, :custom_template_name, :builtin_template_name

      def to_s
        name
      end

      def nics_attributes=(attrs); end

      def volumes_attributes=(attrs); end

      def memory
        memory_static_max.to_i
      end

      def reset
        reboot
      end

      def ready?
        running?
      end

      def mac
        vifs.first.mac
      end

      def state
        power_state
      end

      def vm_description
        _("%{cpus} CPUs and %{memory} memory") % {:cpus => vcpus_max, :memory => number_to_human_size(memory_max.to_i)}
      end

      def interfaces
        vifs
      end

      def select_nic(fog_nics, nic)
        return fog_nics[0]
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_xen-0.1.2 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.1.1 app/models/concerns/fog_extensions/xenserver/server.rb
foreman_xen-0.1.0 app/models/concerns/fog_extensions/xenserver/server.rb