Sha256: f733307cf4d9184aadf98d4611722fb52dfaf79e5e97a4a780aa8bd08f7c5f97

Contents?: true

Size: 1.03 KB

Versions: 80

Compression:

Stored size: 1.03 KB

Contents

module Fog
  module Compute
    class Libvirt
      class Real
        def update_display(options = { })
          raise ArgumentError, "uuid is a required parameter" unless options.has_key? :uuid
          display          = { }
          display[:type]   = options[:type] || 'vnc'
          display[:port]   = (options[:port] || -1).to_s
          display[:listen] = options[:listen].to_s   if options[:listen]
          display[:passwd] = options[:password].to_s if options[:password]
          display[:autoport] = 'yes' if display[:port] == '-1'

          builder = Nokogiri::XML::Builder.new { graphics_ (display) }
          xml     = Nokogiri::XML(builder.to_xml).root.to_s

          client.lookup_domain_by_uuid(options[:uuid]).update_device(xml, 0)
          # if we got no exceptions, then we're good'
          true
        end
      end

      class Mock
        def update_display(options = { })
          raise ArgumentError, "uuid is a required parameter" unless options.has_key? :uuid
          true
        end
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 13 rubygems

Version Path
fog-1.22.0 lib/fog/libvirt/requests/compute/update_display.rb
fog-1.21.0 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/libvirt/requests/compute/update_display.rb
fog-1.20.0 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/libvirt/requests/compute/update_display.rb
fog-1.19.0 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/libvirt/requests/compute/update_display.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/libvirt/requests/compute/update_display.rb