fog-ovirt 1.2.4 → 1.2.5
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/.rubocop.yml +3 -0
- data/Rakefile +1 -1
- data/lib/fog/ovirt/compute/v3.rb +0 -2
- data/lib/fog/ovirt/compute/v4.rb +5 -7
- data/lib/fog/ovirt/models/compute/interfaces.rb +0 -2
- data/lib/fog/ovirt/models/compute/server.rb +0 -2
- data/lib/fog/ovirt/models/compute/volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/add_interface.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +2 -4
- data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +1 -0
- data/lib/fog/ovirt/requests/compute/v4/update_vm.rb +0 -2
- data/lib/fog/ovirt/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7b24b23699c22d16d6f7a5da99f613ec7e7066022e5d6f0097fc15236745db8
|
4
|
+
data.tar.gz: e7f4357f8b657cd35625ebffe798cbc9bc09a65db3cb2aa6d5ec6f9706fad6c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 805c36e9f5631026c94921b4278f1a193e5e52287a270e83a13c7bc1dfcdcd04a9588d76eb572ae5e2c632aba578acad499fd74a6bc3ca1965ac72ce72c37f9c
|
7
|
+
data.tar.gz: 83ce48a44a9f6952b18e8314551529e44cb7caf5df055dfdfb2402a4e976966f1191970538f8c5215f67ecf917c195ef464f841f931e8b2707d6077bf704ab52
|
data/.rubocop.yml
CHANGED
data/Rakefile
CHANGED
data/lib/fog/ovirt/compute/v3.rb
CHANGED
@@ -103,7 +103,6 @@ module Fog
|
|
103
103
|
class Real
|
104
104
|
include Shared
|
105
105
|
|
106
|
-
# rubocop:disable Metrics/AbcSize
|
107
106
|
def initialize(options = {})
|
108
107
|
require "rbovirt"
|
109
108
|
username = options[:ovirt_username]
|
@@ -122,7 +121,6 @@ module Fog
|
|
122
121
|
|
123
122
|
@client = ExceptionWrapper.new(OVIRT::Client.new(username, password, url, connection_opts))
|
124
123
|
end
|
125
|
-
# rubocop:enable Metrics/AbcSize
|
126
124
|
|
127
125
|
def api_version
|
128
126
|
client.api_version
|
data/lib/fog/ovirt/compute/v4.rb
CHANGED
@@ -42,7 +42,7 @@ module Fog
|
|
42
42
|
request :list_operating_systems
|
43
43
|
|
44
44
|
module Shared
|
45
|
-
# rubocop:disable Metrics/
|
45
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
46
46
|
# converts an OVIRT object into an hash for fog to consume.
|
47
47
|
def shared_ovirt_attrs(obj)
|
48
48
|
opts = {}
|
@@ -71,9 +71,9 @@ module Fog
|
|
71
71
|
opts
|
72
72
|
end
|
73
73
|
|
74
|
-
# rubocop:enable Metrics/
|
74
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
75
75
|
|
76
|
-
# rubocop:disable Metrics/
|
76
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
77
77
|
def get_attr_value(value, opts)
|
78
78
|
case value
|
79
79
|
when OvirtSDK4::List
|
@@ -104,14 +104,14 @@ module Fog
|
|
104
104
|
when OvirtSDK4::Console
|
105
105
|
{ :enabled => value.enabled }
|
106
106
|
else
|
107
|
-
if value.class.respond_to?(:
|
107
|
+
if value.class.respond_to?(:module_parent) && value.class.module_parent == OvirtSDK4
|
108
108
|
value.id if value.respond_to?(:id)
|
109
109
|
else
|
110
110
|
value.to_s.strip
|
111
111
|
end
|
112
112
|
end
|
113
113
|
end
|
114
|
-
# rubocop:enable Metrics/
|
114
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
115
115
|
|
116
116
|
def convert_string_to_bool(value)
|
117
117
|
case value
|
@@ -162,7 +162,6 @@ module Fog
|
|
162
162
|
class Real
|
163
163
|
include Shared
|
164
164
|
|
165
|
-
# rubocop:disable Metrics/AbcSize
|
166
165
|
def initialize(options = {})
|
167
166
|
require "ovirtsdk4"
|
168
167
|
username = options[:ovirt_username]
|
@@ -183,7 +182,6 @@ module Fog
|
|
183
182
|
|
184
183
|
@client = ExceptionWrapper.new(OvirtSDK4::Connection.new(connection_opts))
|
185
184
|
end
|
186
|
-
# rubocop:enable Metrics/AbcSize
|
187
185
|
|
188
186
|
def ovirt_attrs(obj)
|
189
187
|
shared_ovirt_attrs(obj) do
|
@@ -9,7 +9,6 @@ module Fog
|
|
9
9
|
|
10
10
|
attr_accessor :vm
|
11
11
|
|
12
|
-
# rubocop:disable Metrics/AbcSize
|
13
12
|
def all(_filters = {})
|
14
13
|
requires :vm
|
15
14
|
if vm.is_a? Fog::Ovirt::Compute::Server
|
@@ -20,7 +19,6 @@ module Fog
|
|
20
19
|
raise ::Fog::Ovirt::Errors::OvirtError, "interfaces should have vm or template"
|
21
20
|
end
|
22
21
|
end
|
23
|
-
# rubocop:enable Metrics/AbcSize
|
24
22
|
|
25
23
|
def get(id)
|
26
24
|
new service.get_interface(id)
|
@@ -121,7 +121,6 @@ module Fog
|
|
121
121
|
vm_power_action(:start)
|
122
122
|
end
|
123
123
|
|
124
|
-
# rubocop:disable Metrics/AbcSize
|
125
124
|
def start_with_cloudinit(options = {})
|
126
125
|
wait_for { !locked? } if options[:blocking]
|
127
126
|
user_data = if options[:use_custom_script]
|
@@ -133,7 +132,6 @@ module Fog
|
|
133
132
|
reload
|
134
133
|
action_status
|
135
134
|
end
|
136
|
-
# rubocop:enable Metrics/AbcSize
|
137
135
|
|
138
136
|
def stop(_options = {})
|
139
137
|
vm_power_action(:stop)
|
@@ -9,7 +9,6 @@ module Fog
|
|
9
9
|
|
10
10
|
attr_accessor :vm
|
11
11
|
|
12
|
-
# rubocop:disable Metrics/AbcSize
|
13
12
|
def all(_filters = {})
|
14
13
|
if vm.is_a? Fog::Ovirt::Compute::Server
|
15
14
|
load service.list_vm_volumes(vm.id)
|
@@ -19,7 +18,6 @@ module Fog
|
|
19
18
|
load service.list_volumes
|
20
19
|
end
|
21
20
|
end
|
22
|
-
# rubocop:enable Metrics/AbcSize
|
23
21
|
|
24
22
|
def get(id)
|
25
23
|
new service.get_volume(id)
|
@@ -3,7 +3,6 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class V4
|
5
5
|
class Real
|
6
|
-
# rubocop:disable Metrics/AbcSize
|
7
6
|
def add_interface(id, options = {})
|
8
7
|
raise ArgumentError, "instance id is a required parameter" unless id
|
9
8
|
vm = client.system_service.vms_service.vm_service(id)
|
@@ -26,7 +25,6 @@ module Fog
|
|
26
25
|
interface = OvirtSDK4::Nic.new(options)
|
27
26
|
nics_service.add(interface)
|
28
27
|
end
|
29
|
-
# rubocop:enable Metrics/AbcSize
|
30
28
|
end
|
31
29
|
|
32
30
|
class Mock
|
@@ -13,7 +13,7 @@ module Fog
|
|
13
13
|
disk_attachments_service.add(disk)
|
14
14
|
end
|
15
15
|
|
16
|
-
# rubocop:disable Metrics/
|
16
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
17
17
|
def add_options_defaults(options)
|
18
18
|
options = options.dup
|
19
19
|
options = convert_string_to_bool(options)
|
@@ -35,7 +35,7 @@ module Fog
|
|
35
35
|
options[:disk][:wipe_after_delete] = options.delete(:wipe_after_delete) if options[:disk][:wipe_after_delete].nil?
|
36
36
|
options
|
37
37
|
end
|
38
|
-
# rubocop:enable Metrics/
|
38
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
39
39
|
end
|
40
40
|
|
41
41
|
class Mock
|
@@ -21,7 +21,7 @@ module Fog
|
|
21
21
|
opts.delete(:disks)
|
22
22
|
end
|
23
23
|
|
24
|
-
# rubocop:disable Metrics/
|
24
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
25
25
|
def create_vm(attrs)
|
26
26
|
attrs = attrs.dup
|
27
27
|
attrs = convert_string_to_bool(attrs)
|
@@ -65,9 +65,8 @@ module Fog
|
|
65
65
|
new_vm = OvirtSDK4::Vm.new(attrs)
|
66
66
|
vms_service.add(new_vm, :clone => attrs[:clone])
|
67
67
|
end
|
68
|
-
# rubocop:enable Metrics/
|
68
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
|
69
69
|
|
70
|
-
# rubocop:disable Metrics/AbcSize
|
71
70
|
def update_os_attrs(attrs)
|
72
71
|
attrs[:os] ||= {}
|
73
72
|
attrs[:os][:type] ||= "Other OS"
|
@@ -76,7 +75,6 @@ module Fog
|
|
76
75
|
|
77
76
|
attrs[:os] = OvirtSDK4::OperatingSystem.new(:type => attrs[:os][:type], :boot => OvirtSDK4::Boot.new(:devices => attrs[:os][:boot]))
|
78
77
|
end
|
79
|
-
# rubocop:enable Metrics/AbcSize
|
80
78
|
end
|
81
79
|
|
82
80
|
class Mock
|
@@ -3,7 +3,6 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class V4
|
5
5
|
class Real
|
6
|
-
# rubocop:disable Metrics/AbcSize
|
7
6
|
def list_template_volumes(template_id)
|
8
7
|
template = client.system_service.templates_service.template_service(template_id).get
|
9
8
|
attachments = client.follow_link(template.disk_attachments)
|
@@ -18,7 +17,6 @@ module Fog
|
|
18
17
|
ovirt_attrs attachment_disk
|
19
18
|
end
|
20
19
|
end
|
21
|
-
# rubocop:enable Metrics/AbcSize
|
22
20
|
end
|
23
21
|
class Mock
|
24
22
|
def list_template_volumes(_template_id)
|
@@ -3,7 +3,6 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class V4
|
5
5
|
class Real
|
6
|
-
# rubocop:disable Metrics/AbcSize
|
7
6
|
def list_vm_volumes(vm_id)
|
8
7
|
vm = client.system_service.vms_service.vm_service(vm_id).get
|
9
8
|
attachments = client.follow_link(vm.disk_attachments)
|
@@ -18,7 +17,6 @@ module Fog
|
|
18
17
|
ovirt_attrs attachment_disk
|
19
18
|
end
|
20
19
|
end
|
21
|
-
# rubocop:enable Metrics/AbcSize
|
22
20
|
end
|
23
21
|
class Mock
|
24
22
|
def list_vm_volumes(_vm_id)
|
@@ -6,6 +6,7 @@ module Fog
|
|
6
6
|
def storage_domains(filter = {})
|
7
7
|
filter = filter.dup
|
8
8
|
role_filter = filter.delete(:role)
|
9
|
+
filter[:search] = create_search_by_datacenter(:search => filter[:search], :datacenter => datacenter_hash[:name])
|
9
10
|
client.system_service.storage_domains_service.list(filter).collect do |sd|
|
10
11
|
# Filter by role is not supported by the search language. The work around is to list all, then filter.
|
11
12
|
role_filter.nil? || sd.type == role_filter ? sd : nil
|
@@ -3,7 +3,6 @@ module Fog
|
|
3
3
|
class Compute
|
4
4
|
class V4
|
5
5
|
class Real
|
6
|
-
# rubocop:disable Metrics/AbcSize
|
7
6
|
def update_vm(attrs)
|
8
7
|
attrs = attrs.dup
|
9
8
|
attrs = convert_string_to_bool(attrs)
|
@@ -34,7 +33,6 @@ module Fog
|
|
34
33
|
end
|
35
34
|
vm_service.update(attrs)
|
36
35
|
end
|
37
|
-
# rubocop:enable Metrics/AbcSize
|
38
36
|
|
39
37
|
def wrap_attribute(attrs, attribute, klass)
|
40
38
|
if attrs[attribute].present?
|
data/lib/fog/ovirt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fog-ovirt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ori Rabin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -360,7 +360,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
360
360
|
- !ruby/object:Gem::Version
|
361
361
|
version: '0'
|
362
362
|
requirements: []
|
363
|
-
rubygems_version: 3.0.
|
363
|
+
rubygems_version: 3.0.8
|
364
364
|
signing_key:
|
365
365
|
specification_version: 4
|
366
366
|
summary: Module for the 'fog' gem to support Ovirt.
|