fog-libvirt 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/fog-libvirt.gemspec +2 -2
- data/lib/fog/libvirt/compute.rb +7 -7
- data/lib/fog/libvirt/models/compute/server.rb +4 -1
- data/lib/fog/libvirt/models/compute/templates/server.xml.erb +10 -0
- data/lib/fog/libvirt/models/compute/templates/volume.xml.erb +4 -0
- data/lib/fog/libvirt/models/compute/volume.rb +2 -2
- data/lib/fog/libvirt/requests/compute/list_networks.rb +1 -1
- data/lib/fog/libvirt/version.rb +1 -1
- data/minitests/server/user_data_iso_test.rb +0 -3
- data/minitests/test_helper.rb +1 -1
- data/tests/helper.rb +1 -1
- data/tests/helpers/formats_helper.rb +58 -56
- data/tests/helpers/formats_helper_tests.rb +22 -25
- data/tests/helpers/mock_helper.rb +1 -1
- data/tests/helpers/succeeds_helper.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6c5d75c89309efc19a2a8e70db7f95dc754fe127358089bd8ebe0cd0f2ecf896
|
|
4
|
+
data.tar.gz: 2270fa713728f8824dffc45dca9344c1b244feeb3add91130d26fff493c00f18
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1834c04363667e8bb7632055010f7544ec72aec0f49254e8c708bc1b73c0d731aa6474acd01644de9fa35d43491bfd5d7e60d3a6636d6301ba2446f6470b80cd
|
|
7
|
+
data.tar.gz: f6834023432a36058571b78e8c1b8f5ec5a5043990d8f738cbf7c986a9038a8a723415214fa702bc7ad09c83fbd119b961ea4ee5c0bc6ebd328b0ab744f12158
|
data/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
fog-libvirt is a libvirt provider for [fog](https://github.com/fog/fog).
|
|
4
4
|
|
|
5
|
-
[](https://github.com/fog/fog-libvirt/actions/workflows/ruby.yml)
|
|
6
6
|
[](https://gemnasium.com/fog/fog-libvirt)
|
|
7
7
|
[](https://codeclimate.com/github/fog/fog-libvirt)
|
|
8
8
|
[](http://badge.fury.io/rb/fog-libvirt)
|
data/fog-libvirt.gemspec
CHANGED
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
|
|
|
23
23
|
s.rdoc_options = ["--charset=UTF-8"]
|
|
24
24
|
s.extra_rdoc_files = %w[README.md]
|
|
25
25
|
|
|
26
|
-
s.required_ruby_version = '>= 2.
|
|
26
|
+
s.required_ruby_version = '>= 2.5.0'
|
|
27
27
|
|
|
28
28
|
s.add_dependency("fog-core", ">= 1.27.4")
|
|
29
29
|
s.add_dependency("fog-json")
|
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
|
40
40
|
s.add_development_dependency("shindo", "~> 0.3.4")
|
|
41
41
|
s.add_development_dependency("simplecov")
|
|
42
42
|
s.add_development_dependency("yard")
|
|
43
|
-
s.add_development_dependency("mocha", "~> 1.
|
|
43
|
+
s.add_development_dependency("mocha", "~> 1.13.0")
|
|
44
44
|
|
|
45
45
|
# Let's not ship dot files and gemfiles
|
|
46
46
|
git_files = `git ls-files`.split("\n")
|
data/lib/fog/libvirt/compute.rb
CHANGED
|
@@ -120,16 +120,16 @@ module Fog
|
|
|
120
120
|
# on macosx, chances are we are using libvirt through homebrew
|
|
121
121
|
# the client will default to a socket location based on it's own location (/opt)
|
|
122
122
|
# we conveniently point it to /var/run/libvirt/libvirt-sock
|
|
123
|
-
# if no socket option has been specified explicitly
|
|
123
|
+
# if no socket option has been specified explicitly and
|
|
124
|
+
# if the socket exists
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
socketpath="/var/run/libvirt/libvirt-sock"
|
|
127
|
+
if RUBY_PLATFORM =~ /darwin/ && File.exist?(socketpath)
|
|
126
128
|
querystring=::URI.parse(uri).query
|
|
127
129
|
if querystring.nil?
|
|
128
|
-
append="?socket
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
append="&socket=/var/run/libvirt/libvirt-sock"
|
|
132
|
-
end
|
|
130
|
+
append="?socket=#{socketpath}"
|
|
131
|
+
elsif !::CGI.parse(querystring).key?("socket")
|
|
132
|
+
append="&socket=#{socketpath}"
|
|
133
133
|
end
|
|
134
134
|
end
|
|
135
135
|
uri+append
|
|
@@ -347,6 +347,9 @@ module Fog
|
|
|
347
347
|
ip_address.chomp
|
|
348
348
|
end
|
|
349
349
|
|
|
350
|
+
# Locale-friendly removal of non-alpha nums
|
|
351
|
+
DOMAIN_CLEANUP_REGEXP = Regexp.compile('[\W_-]')
|
|
352
|
+
|
|
350
353
|
# This retrieves the ip address of the mac address using ip_command
|
|
351
354
|
# It returns an array of public and private ip addresses
|
|
352
355
|
# Currently only one ip address is returned, but in the future this could be multiple
|
|
@@ -360,7 +363,7 @@ module Fog
|
|
|
360
363
|
ip_command_global=service_arg.ip_command.nil? ? 'grep $mac /var/log/arpwatch.log|sed -e "s/new station//"|sed -e "s/changed ethernet address//g" |sed -e "s/reused old ethernet //" |tail -1 |cut -d ":" -f 4-| cut -d " " -f 3' : service_arg.ip_command
|
|
361
364
|
ip_command_local=options[:ip_command].nil? ? ip_command_global : options[:ip_command]
|
|
362
365
|
|
|
363
|
-
ip_command="mac=#{mac}; server_name=#{name}; "+ip_command_local
|
|
366
|
+
ip_command="mac=#{mac}; server_name=#{name.gsub(DOMAIN_CLEANUP_REGEXP, '_')}; "+ip_command_local
|
|
364
367
|
|
|
365
368
|
ip_address=nil
|
|
366
369
|
|
|
@@ -110,6 +110,13 @@
|
|
|
110
110
|
<backend model='<%= rng_backend_model %>'/>
|
|
111
111
|
<% end -%>
|
|
112
112
|
</rng>
|
|
113
|
+
<% if arch == "s390x" -%>
|
|
114
|
+
<controller type="scsi" index="0" model="virtio-scsi"/>
|
|
115
|
+
<console type="pty">
|
|
116
|
+
<target type="sclp"/>
|
|
117
|
+
</console>
|
|
118
|
+
<memballoon model="virtio"/>
|
|
119
|
+
<% else -%>
|
|
113
120
|
<serial type='pty'>
|
|
114
121
|
<target port='0'/>
|
|
115
122
|
</serial>
|
|
@@ -118,6 +125,7 @@
|
|
|
118
125
|
</console>
|
|
119
126
|
<input type='tablet' bus='usb'/>
|
|
120
127
|
<input type='mouse' bus='ps2'/>
|
|
128
|
+
<% end -%>
|
|
121
129
|
<%
|
|
122
130
|
display_type = display[:type]
|
|
123
131
|
|
|
@@ -137,9 +145,11 @@ unless display[:password].empty?
|
|
|
137
145
|
display_password = "passwd='#{display[:password]}'"
|
|
138
146
|
end
|
|
139
147
|
-%>
|
|
148
|
+
<% if arch != "s390x" -%>
|
|
140
149
|
<graphics type='<%= display_type %>' port='<%= display_port %>' autoport='<%= autoport %>' <%= display_listen %> <%= display_password %> />
|
|
141
150
|
<video>
|
|
142
151
|
<model type='cirrus' vram='9216' heads='1'/>
|
|
143
152
|
</video>
|
|
153
|
+
<% end -%>
|
|
144
154
|
</devices>
|
|
145
155
|
</domain>
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
<target>
|
|
6
6
|
<format type="<%= format_type %>"/>
|
|
7
7
|
<permissions>
|
|
8
|
+
<% if owner -%>
|
|
8
9
|
<owner><%= owner %></owner>
|
|
10
|
+
<% end -%>
|
|
11
|
+
<% if group -%>
|
|
9
12
|
<group><%= group %></group>
|
|
13
|
+
<% end -%>
|
|
10
14
|
<mode>0744</mode>
|
|
11
15
|
<label>virt_image_t</label>
|
|
12
16
|
</permissions>
|
data/lib/fog/libvirt/version.rb
CHANGED
|
@@ -32,7 +32,6 @@ class UserDataIsoTest < Minitest::Test
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def test_volume_is_created_during_user_data_iso_generation
|
|
35
|
-
iso_path = "iso_file_path"
|
|
36
35
|
@server.stubs(:system).returns(true)
|
|
37
36
|
Fog::Libvirt::Compute::Volumes.any_instance.expects(:create).
|
|
38
37
|
with(has_entries(:name => @server.cloud_init_volume_name)).
|
|
@@ -43,7 +42,6 @@ class UserDataIsoTest < Minitest::Test
|
|
|
43
42
|
end
|
|
44
43
|
|
|
45
44
|
def test_volume_is_uploaded_during_user_data_iso_generation
|
|
46
|
-
iso_path = "iso_file_path"
|
|
47
45
|
@server.stubs(:system).returns(true)
|
|
48
46
|
Fog::Libvirt::Compute::Volumes.any_instance.stubs(:create).returns(@compute.volumes.new)
|
|
49
47
|
Fog::Libvirt::Compute::Volume.any_instance.expects(:upload_image).returns(true)
|
|
@@ -52,7 +50,6 @@ class UserDataIsoTest < Minitest::Test
|
|
|
52
50
|
end
|
|
53
51
|
|
|
54
52
|
def test_iso_file_is_set_during_user_data_iso_generation
|
|
55
|
-
iso_path = "iso_file_path"
|
|
56
53
|
@server.stubs(:system).returns(true)
|
|
57
54
|
Fog::Libvirt::Compute::Volumes.any_instance.stubs(:create).returns(@compute.volumes.new)
|
|
58
55
|
Fog::Libvirt::Compute::Volume.any_instance.stubs(:upload_image)
|
data/minitests/test_helper.rb
CHANGED
data/tests/helper.rb
CHANGED
|
@@ -3,7 +3,7 @@ ENV['FOG_CREDENTIAL'] = ENV['FOG_CREDENTIAL'] || 'default'
|
|
|
3
3
|
|
|
4
4
|
require 'fog/libvirt'
|
|
5
5
|
|
|
6
|
-
Excon.defaults.merge!(:
|
|
6
|
+
Excon.defaults.merge!(debug_request: true, debug_response: true)
|
|
7
7
|
|
|
8
8
|
require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'mock_helper'))
|
|
9
9
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'fog/schema/data_validator'
|
|
2
4
|
|
|
3
5
|
# format related hackery
|
|
4
6
|
# allows both true.is_a?(Fog::Boolean) and false.is_a?(Fog::Boolean)
|
|
@@ -15,62 +17,62 @@ module Fog
|
|
|
15
17
|
module Array; end
|
|
16
18
|
end
|
|
17
19
|
end
|
|
18
|
-
[FalseClass, TrueClass].each {|klass| klass.send(:include, Fog::Boolean)}
|
|
19
|
-
[FalseClass, TrueClass, NilClass, Fog::Boolean].each {|klass| klass.send(:include, Fog::Nullable::Boolean)}
|
|
20
|
-
[NilClass, String].each {|klass| klass.send(:include, Fog::Nullable::String)}
|
|
21
|
-
[NilClass, Time].each {|klass| klass.send(:include, Fog::Nullable::Time)}
|
|
22
|
-
[Integer, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Integer)}
|
|
23
|
-
[Float, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Float)}
|
|
24
|
-
[Hash, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Hash)}
|
|
25
|
-
[Array, NilClass].each {|klass| klass.send(:include, Fog::Nullable::Array)}
|
|
20
|
+
[FalseClass, TrueClass].each { |klass| klass.send(:include, Fog::Boolean) }
|
|
21
|
+
[FalseClass, TrueClass, NilClass, Fog::Boolean].each { |klass| klass.send(:include, Fog::Nullable::Boolean) }
|
|
22
|
+
[NilClass, String].each { |klass| klass.send(:include, Fog::Nullable::String) }
|
|
23
|
+
[NilClass, Time].each { |klass| klass.send(:include, Fog::Nullable::Time) }
|
|
24
|
+
[Integer, NilClass].each { |klass| klass.send(:include, Fog::Nullable::Integer) }
|
|
25
|
+
[Float, NilClass].each { |klass| klass.send(:include, Fog::Nullable::Float) }
|
|
26
|
+
[Hash, NilClass].each { |klass| klass.send(:include, Fog::Nullable::Hash) }
|
|
27
|
+
[Array, NilClass].each { |klass| klass.send(:include, Fog::Nullable::Array) }
|
|
26
28
|
|
|
27
29
|
module Shindo
|
|
30
|
+
# Generates a Shindo test that compares a hash schema to the result
|
|
31
|
+
# of the passed in block returning true if they match.
|
|
32
|
+
#
|
|
33
|
+
# The schema that is passed in is a Hash or Array of hashes that
|
|
34
|
+
# have Classes in place of values. When checking the schema the
|
|
35
|
+
# value should match the Class.
|
|
36
|
+
#
|
|
37
|
+
# Strict mode will fail if the data has additional keys. Setting
|
|
38
|
+
# +strict+ to +false+ will allow additional keys to appear.
|
|
39
|
+
#
|
|
40
|
+
# @param [Hash] schema A Hash schema
|
|
41
|
+
# @param [Hash] options Options to change validation rules
|
|
42
|
+
# @option options [Boolean] :allow_extra_keys
|
|
43
|
+
# If +true+ does not fail when keys are in the data that are
|
|
44
|
+
# not specified in the schema. This allows new values to
|
|
45
|
+
# appear in API output without breaking the check.
|
|
46
|
+
# @option options [Boolean] :allow_optional_rules
|
|
47
|
+
# If +true+ does not fail if extra keys are in the schema
|
|
48
|
+
# that do not match the data. Not recommended!
|
|
49
|
+
# @yield Data to check with schema
|
|
50
|
+
#
|
|
51
|
+
# @example Using in a test
|
|
52
|
+
# Shindo.tests("comparing welcome data against schema") do
|
|
53
|
+
# data = {:welcome => "Hello" }
|
|
54
|
+
# data_matches_schema(:welcome => String) { data }
|
|
55
|
+
# end
|
|
56
|
+
#
|
|
57
|
+
# comparing welcome data against schema
|
|
58
|
+
# + data matches schema
|
|
59
|
+
#
|
|
60
|
+
# @example Example schema
|
|
61
|
+
# {
|
|
62
|
+
# "id" => String,
|
|
63
|
+
# "ram" => Integer,
|
|
64
|
+
# "disks" => [
|
|
65
|
+
# {
|
|
66
|
+
# "size" => Float
|
|
67
|
+
# }
|
|
68
|
+
# ],
|
|
69
|
+
# "dns_name" => Fog::Nullable::String,
|
|
70
|
+
# "active" => Fog::Boolean,
|
|
71
|
+
# "created" => DateTime
|
|
72
|
+
# }
|
|
73
|
+
#
|
|
74
|
+
# @return [Boolean]
|
|
28
75
|
class Tests
|
|
29
|
-
# Generates a Shindo test that compares a hash schema to the result
|
|
30
|
-
# of the passed in block returning true if they match.
|
|
31
|
-
#
|
|
32
|
-
# The schema that is passed in is a Hash or Array of hashes that
|
|
33
|
-
# have Classes in place of values. When checking the schema the
|
|
34
|
-
# value should match the Class.
|
|
35
|
-
#
|
|
36
|
-
# Strict mode will fail if the data has additional keys. Setting
|
|
37
|
-
# +strict+ to +false+ will allow additional keys to appear.
|
|
38
|
-
#
|
|
39
|
-
# @param [Hash] schema A Hash schema
|
|
40
|
-
# @param [Hash] options Options to change validation rules
|
|
41
|
-
# @option options [Boolean] :allow_extra_keys
|
|
42
|
-
# If +true+ does not fail when keys are in the data that are
|
|
43
|
-
# not specified in the schema. This allows new values to
|
|
44
|
-
# appear in API output without breaking the check.
|
|
45
|
-
# @option options [Boolean] :allow_optional_rules
|
|
46
|
-
# If +true+ does not fail if extra keys are in the schema
|
|
47
|
-
# that do not match the data. Not recommended!
|
|
48
|
-
# @yield Data to check with schema
|
|
49
|
-
#
|
|
50
|
-
# @example Using in a test
|
|
51
|
-
# Shindo.tests("comparing welcome data against schema") do
|
|
52
|
-
# data = {:welcome => "Hello" }
|
|
53
|
-
# data_matches_schema(:welcome => String) { data }
|
|
54
|
-
# end
|
|
55
|
-
#
|
|
56
|
-
# comparing welcome data against schema
|
|
57
|
-
# + data matches schema
|
|
58
|
-
#
|
|
59
|
-
# @example Example schema
|
|
60
|
-
# {
|
|
61
|
-
# "id" => String,
|
|
62
|
-
# "ram" => Integer,
|
|
63
|
-
# "disks" => [
|
|
64
|
-
# {
|
|
65
|
-
# "size" => Float
|
|
66
|
-
# }
|
|
67
|
-
# ],
|
|
68
|
-
# "dns_name" => Fog::Nullable::String,
|
|
69
|
-
# "active" => Fog::Boolean,
|
|
70
|
-
# "created" => DateTime
|
|
71
|
-
# }
|
|
72
|
-
#
|
|
73
|
-
# @return [Boolean]
|
|
74
76
|
def data_matches_schema(schema, options = {})
|
|
75
77
|
test('data matches schema') do
|
|
76
78
|
validator = Fog::Schema::DataValidator.new
|
|
@@ -84,9 +86,9 @@ module Shindo
|
|
|
84
86
|
def formats(format, strict = true)
|
|
85
87
|
test('has proper format') do
|
|
86
88
|
if strict
|
|
87
|
-
options = {:
|
|
89
|
+
options = { allow_extra_keys: false, allow_optional_rules: true }
|
|
88
90
|
else
|
|
89
|
-
options = {:
|
|
91
|
+
options = { allow_extra_keys: true, allow_optional_rules: true }
|
|
90
92
|
end
|
|
91
93
|
validator = Fog::Schema::DataValidator.new
|
|
92
94
|
valid = validator.validate(yield, format, options)
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
Shindo.tests('test_helper', 'meta') do
|
|
2
2
|
|
|
3
3
|
tests('comparing welcome data against schema') do
|
|
4
|
-
data = {:
|
|
5
|
-
data_matches_schema(:
|
|
4
|
+
data = { welcome: 'Hello' }
|
|
5
|
+
data_matches_schema(welcome: String) { data }
|
|
6
6
|
end
|
|
7
7
|
|
|
8
8
|
tests('#data_matches_schema') do
|
|
9
9
|
tests('when value matches schema expectation') do
|
|
10
|
-
data_matches_schema(
|
|
10
|
+
data_matches_schema('key' => String) { { 'key' => 'Value' } }
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
tests('when values within an array all match schema expectation') do
|
|
14
|
-
data_matches_schema(
|
|
14
|
+
data_matches_schema('key' => [Integer]) { { 'key' => [1, 2] } }
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
tests('when nested values match schema expectation') do
|
|
18
|
-
data_matches_schema(
|
|
18
|
+
data_matches_schema('key' => { nested_key: String }) { { 'key' => { nested_key: 'Value' } } }
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
tests('when collection of values all match schema expectation') do
|
|
22
|
-
data_matches_schema([{
|
|
22
|
+
data_matches_schema([{ 'key' => String }]) { [{ 'key' => 'Value' }, { 'key' => 'Value' }] }
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
tests('when collection is empty although schema covers optional members') do
|
|
26
|
-
data_matches_schema([{
|
|
26
|
+
data_matches_schema([{ 'key' => String }], allow_optional_rules: true) { [] }
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
tests('when additional keys are passed and not strict') do
|
|
30
|
-
data_matches_schema({
|
|
30
|
+
data_matches_schema({ 'key' => String }, allow_extra_keys: true) { { 'key' => 'Value', extra: 'Bonus' } }
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
tests('when value is nil and schema expects NilClass') do
|
|
34
|
-
data_matches_schema(
|
|
34
|
+
data_matches_schema('key' => NilClass) { { 'key' => nil } }
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
tests('when value and schema match as hashes') do
|
|
@@ -43,46 +43,45 @@ Shindo.tests('test_helper', 'meta') do
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
tests('when value is a Time') do
|
|
46
|
-
data_matches_schema(
|
|
46
|
+
data_matches_schema('time' => Time) { { 'time' => Time.now } }
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
tests('when key is missing but value should be NilClass (#1477)') do
|
|
50
|
-
data_matches_schema({
|
|
50
|
+
data_matches_schema({ 'key' => NilClass }, allow_optional_rules: true) { {} }
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
tests('when key is missing but value is nullable (#1477)') do
|
|
54
|
-
data_matches_schema({
|
|
54
|
+
data_matches_schema({ 'key' => Fog::Nullable::String }, allow_optional_rules: true) { {} }
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
tests('#formats backwards compatible changes') do
|
|
59
|
-
|
|
60
59
|
tests('when value matches schema expectation') do
|
|
61
|
-
formats(
|
|
60
|
+
formats('key' => String) { { 'key' => 'Value' } }
|
|
62
61
|
end
|
|
63
62
|
|
|
64
63
|
tests('when values within an array all match schema expectation') do
|
|
65
|
-
formats(
|
|
64
|
+
formats('key' => [Integer]) { { 'key' => [1, 2] } }
|
|
66
65
|
end
|
|
67
66
|
|
|
68
67
|
tests('when nested values match schema expectation') do
|
|
69
|
-
formats(
|
|
68
|
+
formats('key' => { nested_key: String }) { { 'key' => { nested_key: 'Value' } } }
|
|
70
69
|
end
|
|
71
70
|
|
|
72
71
|
tests('when collection of values all match schema expectation') do
|
|
73
|
-
formats([{
|
|
72
|
+
formats([{ 'key' => String }]) { [{ 'key' => 'Value' }, { 'key' => 'Value' }] }
|
|
74
73
|
end
|
|
75
74
|
|
|
76
75
|
tests('when collection is empty although schema covers optional members') do
|
|
77
|
-
formats([{
|
|
76
|
+
formats([{ 'key' => String }]) { [] }
|
|
78
77
|
end
|
|
79
78
|
|
|
80
79
|
tests('when additional keys are passed and not strict') do
|
|
81
|
-
formats({
|
|
80
|
+
formats({ 'key' => String }, false) { { 'key' => 'Value', :extra => 'Bonus' } }
|
|
82
81
|
end
|
|
83
82
|
|
|
84
83
|
tests('when value is nil and schema expects NilClass') do
|
|
85
|
-
formats(
|
|
84
|
+
formats('key' => NilClass) { { 'key' => nil } }
|
|
86
85
|
end
|
|
87
86
|
|
|
88
87
|
tests('when value and schema match as hashes') do
|
|
@@ -94,17 +93,15 @@ Shindo.tests('test_helper', 'meta') do
|
|
|
94
93
|
end
|
|
95
94
|
|
|
96
95
|
tests('when value is a Time') do
|
|
97
|
-
formats(
|
|
96
|
+
formats('time' => Time) { { 'time' => Time.now } }
|
|
98
97
|
end
|
|
99
98
|
|
|
100
99
|
tests('when key is missing but value should be NilClass (#1477)') do
|
|
101
|
-
formats(
|
|
100
|
+
formats('key' => NilClass) { {} }
|
|
102
101
|
end
|
|
103
102
|
|
|
104
103
|
tests('when key is missing but value is nullable (#1477)') do
|
|
105
|
-
formats(
|
|
104
|
+
formats('key' => Fog::Nullable::String) { {} }
|
|
106
105
|
end
|
|
107
|
-
|
|
108
106
|
end
|
|
109
|
-
|
|
110
107
|
end
|
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.9.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: 2021-
|
|
11
|
+
date: 2021-07-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: fog-core
|
|
@@ -212,14 +212,14 @@ dependencies:
|
|
|
212
212
|
requirements:
|
|
213
213
|
- - "~>"
|
|
214
214
|
- !ruby/object:Gem::Version
|
|
215
|
-
version: 1.
|
|
215
|
+
version: 1.13.0
|
|
216
216
|
type: :development
|
|
217
217
|
prerelease: false
|
|
218
218
|
version_requirements: !ruby/object:Gem::Requirement
|
|
219
219
|
requirements:
|
|
220
220
|
- - "~>"
|
|
221
221
|
- !ruby/object:Gem::Version
|
|
222
|
-
version: 1.
|
|
222
|
+
version: 1.13.0
|
|
223
223
|
description: This library can be used as a module for 'fog' or as standalone libvirt
|
|
224
224
|
provider.
|
|
225
225
|
email: geemus@gmail.com
|
|
@@ -321,14 +321,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
321
321
|
requirements:
|
|
322
322
|
- - ">="
|
|
323
323
|
- !ruby/object:Gem::Version
|
|
324
|
-
version: 2.
|
|
324
|
+
version: 2.5.0
|
|
325
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
326
|
requirements:
|
|
327
327
|
- - ">="
|
|
328
328
|
- !ruby/object:Gem::Version
|
|
329
329
|
version: '0'
|
|
330
330
|
requirements: []
|
|
331
|
-
rubygems_version: 3.
|
|
331
|
+
rubygems_version: 3.2.15
|
|
332
332
|
signing_key:
|
|
333
333
|
specification_version: 2
|
|
334
334
|
summary: Module for the 'fog' gem to support libvirt
|