fog-libvirt 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4afcefce8f2992462c7cf5d12ac7ffc9cd38f4cd
|
4
|
+
data.tar.gz: 9fa64b79e0aaad64571f7bc97e3a0dce4d093e18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c744b112ac1546eca142ca8792ba010a272cf82e7ba58e8163f11397c8f634cd64281fe5a5c52468fb5bfe1c9d71e97676113ccf18e292382a4ef33d64393663
|
7
|
+
data.tar.gz: ad1ec45643362138a52382e17fb297eef06b6bdfd589e13f7d075f1747068c6ea8749ed7683d2336a69e9f794d546894d3e23340f23a2f50c1129257acf7c8b1
|
data/CONTRIBUTORS.md
CHANGED
@@ -27,6 +27,7 @@ module Fog
|
|
27
27
|
attribute :active
|
28
28
|
attribute :boot_order
|
29
29
|
attribute :display
|
30
|
+
attribute :cpu
|
30
31
|
|
31
32
|
attribute :state
|
32
33
|
|
@@ -186,7 +187,7 @@ module Fog
|
|
186
187
|
|
187
188
|
credentials[:proxy]= ssh_proxy unless ssh_proxy.nil?
|
188
189
|
credentials[:password] = password unless self.password.nil?
|
189
|
-
|
190
|
+
credentials[:key_data] = [private_key] if self.private_key
|
190
191
|
|
191
192
|
commands = [
|
192
193
|
%{mkdir .ssh},
|
@@ -236,7 +237,7 @@ module Fog
|
|
236
237
|
|
237
238
|
isofile = Tempfile.new(['init', '.iso']).path
|
238
239
|
unless system("genisoimage -output #{isofile} -volid cidata -joliet -rock #{File.join(dir_path, 'user-data')} #{File.join(dir_path, 'meta-data')}")
|
239
|
-
raise Fog::Errors::Error("Couldn't generate cloud-init iso disk.")
|
240
|
+
raise Fog::Errors::Error.new("Couldn't generate cloud-init iso disk with genisoimage.")
|
240
241
|
end
|
241
242
|
blk.call(isofile)
|
242
243
|
end
|
@@ -347,7 +348,8 @@ module Fog
|
|
347
348
|
:network_nat_network => "default",
|
348
349
|
:network_bridge_name => "br0",
|
349
350
|
:boot_order => %w[hd cdrom network],
|
350
|
-
:display => default_display
|
351
|
+
:display => default_display,
|
352
|
+
:cpu => {}
|
351
353
|
}
|
352
354
|
end
|
353
355
|
|
@@ -13,6 +13,23 @@
|
|
13
13
|
<apic/>
|
14
14
|
<pae/>
|
15
15
|
</features>
|
16
|
+
<% if !cpu.empty? -%>
|
17
|
+
<% if cpu[:mode] -%>
|
18
|
+
<cpu mode='<%= cpu[:mode] %>'>
|
19
|
+
<% else -%>
|
20
|
+
<cpu>
|
21
|
+
<% end -%>
|
22
|
+
<%
|
23
|
+
fallback = 'allow'
|
24
|
+
model = ''
|
25
|
+
if cpu[:model]
|
26
|
+
fallback = cpu[:model][:fallback] if cpu[:model][:fallback]
|
27
|
+
model = cpu[:model][:name] if cpu[:model][:name]
|
28
|
+
end
|
29
|
+
-%>
|
30
|
+
<model fallback='<%= fallback %>'><%= model %></model>
|
31
|
+
</cpu>
|
32
|
+
<% end -%>
|
16
33
|
<clock offset='utc'/>
|
17
34
|
<devices>
|
18
35
|
<% volumes.each do |vol| -%>
|
@@ -46,7 +63,26 @@
|
|
46
63
|
</console>
|
47
64
|
<input type='tablet' bus='usb'/>
|
48
65
|
<input type='mouse' bus='ps2'/>
|
49
|
-
|
66
|
+
<%
|
67
|
+
display_type = display[:type]
|
68
|
+
|
69
|
+
if display[:port].empty?
|
70
|
+
display_port = display[:port]
|
71
|
+
autoport = 'no'
|
72
|
+
else
|
73
|
+
display_port = '-1'
|
74
|
+
autoport = 'yes'
|
75
|
+
end
|
76
|
+
|
77
|
+
unless display[:listen].empty?
|
78
|
+
display_listen = "listen='#{display[:listen]}'"
|
79
|
+
end
|
80
|
+
|
81
|
+
unless display[:password].empty?
|
82
|
+
display_password = "passwd='#{display[:password]}'"
|
83
|
+
end
|
84
|
+
-%>
|
85
|
+
<graphics type='<%= display_type %>' port='<%= display_port %>' autoport='<%= autoport %>' <%= display_listen %> <%= display_password %> />
|
50
86
|
<video>
|
51
87
|
<model type='cirrus' vram='9216' heads='1'/>
|
52
88
|
</video>
|
@@ -4,17 +4,21 @@ module Fog
|
|
4
4
|
class Real
|
5
5
|
def update_display(options = { })
|
6
6
|
raise ArgumentError, "uuid is a required parameter" unless options.key? :uuid
|
7
|
+
|
8
|
+
domain = client.lookup_domain_by_uuid(options[:uuid])
|
9
|
+
|
7
10
|
display = { }
|
8
11
|
display[:type] = options[:type] || 'vnc'
|
9
12
|
display[:port] = (options[:port] || -1).to_s
|
10
13
|
display[:listen] = options[:listen].to_s if options[:listen]
|
11
14
|
display[:passwd] = options[:password].to_s if options[:password]
|
12
15
|
display[:autoport] = 'yes' if display[:port] == '-1'
|
16
|
+
display[:keymap] = options[:keymap] || xml_elements(domain.xml_desc, "graphics", "keymap")
|
13
17
|
|
14
18
|
builder = Nokogiri::XML::Builder.new { graphics_ (display) }
|
15
19
|
xml = Nokogiri::XML(builder.to_xml).root.to_s
|
16
20
|
|
17
|
-
|
21
|
+
domain.update_device(xml, 0)
|
18
22
|
# if we got no exceptions, then we're good'
|
19
23
|
true
|
20
24
|
end
|
data/lib/fog/libvirt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-libvirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- geemus (Wesley Beary)
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -317,7 +317,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
317
|
version: '0'
|
318
318
|
requirements: []
|
319
319
|
rubyforge_project:
|
320
|
-
rubygems_version: 2.
|
320
|
+
rubygems_version: 2.6.11
|
321
321
|
signing_key:
|
322
322
|
specification_version: 2
|
323
323
|
summary: Module for the 'fog' gem to support libvirt
|
@@ -344,4 +344,3 @@ test_files:
|
|
344
344
|
- tests/libvirt/requests/compute/define_domain_tests.rb
|
345
345
|
- tests/libvirt/requests/compute/dhcp_leases_tests.rb
|
346
346
|
- tests/libvirt/requests/compute/update_display.rb
|
347
|
-
has_rdoc:
|