fog-ovirt 1.2.2 → 1.2.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9035effc2ab1bfc2040120139b903ab93f9c981dc0f5ce34540d8ab1dbe3d5f3
|
4
|
+
data.tar.gz: 2fd5d0441dba96b14a7ce3bf673531c602094f05ecc1e6f42d1a63f7474398f3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a06c551b333e792e26b0634d7b9613536c070451d13590435cf03c1b471f7cabdbef0cb97afc72a377cded5f08974ddde79ab99d3558f1b5c0d78d0a6394d2b7
|
7
|
+
data.tar.gz: 12dad14839f2e98b11211cbf9115cd822fd2c82be4abd39b9413c9dc42a1b412f73ad8e5de7191dc26ffea6cc750b69e88f452bf885962d6bf49863779d616b3
|
data/lib/fog/ovirt/compute/v4.rb
CHANGED
@@ -44,7 +44,7 @@ module Fog
|
|
44
44
|
module Shared
|
45
45
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
46
46
|
# converts an OVIRT object into an hash for fog to consume.
|
47
|
-
def
|
47
|
+
def shared_ovirt_attrs(obj)
|
48
48
|
opts = {}
|
49
49
|
# TODO: stop using instance_variables, they will change
|
50
50
|
obj.instance_variables.each do |v|
|
@@ -52,7 +52,7 @@ module Fog
|
|
52
52
|
value = obj.instance_variable_get(v)
|
53
53
|
|
54
54
|
if key == :network
|
55
|
-
opts[key] = obj.vnic_profile.present? ?
|
55
|
+
opts[key] = obj.vnic_profile.present? ? yield(obj) : value
|
56
56
|
next
|
57
57
|
end
|
58
58
|
|
@@ -70,6 +70,7 @@ module Fog
|
|
70
70
|
end
|
71
71
|
opts
|
72
72
|
end
|
73
|
+
|
73
74
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
74
75
|
|
75
76
|
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
@@ -138,6 +139,13 @@ module Fog
|
|
138
139
|
require "ovirtsdk4"
|
139
140
|
end
|
140
141
|
|
142
|
+
def ovirt_attrs(obj)
|
143
|
+
shared_ovirt_attrs(obj) do
|
144
|
+
xml = read_xml("vnic_profile.xml")
|
145
|
+
Nokogiri::XML(xml).xpath("/vnic_profile/network/@id").to_s
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
141
149
|
private
|
142
150
|
|
143
151
|
def client
|
@@ -177,17 +185,23 @@ module Fog
|
|
177
185
|
end
|
178
186
|
# rubocop:enable Metrics/AbcSize
|
179
187
|
|
188
|
+
def ovirt_attrs(obj)
|
189
|
+
shared_ovirt_attrs(obj) do
|
190
|
+
client.follow_link(obj.vnic_profile).network.id
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
180
194
|
def api_version
|
181
195
|
api = client.system_service.get
|
182
196
|
api.product_info.version.full_version
|
183
197
|
end
|
184
198
|
|
185
199
|
def datacenter
|
186
|
-
|
200
|
+
datacenter_hash[:id]
|
187
201
|
end
|
188
202
|
|
189
203
|
def datacenter_hash
|
190
|
-
@datacenter_hash ||= datacenters.find { |x| x[:id] == @datacenter } if @datacenter
|
204
|
+
@datacenter_hash ||= datacenters.find { |x| x[:id] == @datacenter } || datacenters.find { |x| x[:name] == @datacenter } if @datacenter
|
191
205
|
@datacenter_hash ||= datacenters.first
|
192
206
|
end
|
193
207
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<vnic_profile href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398" id="0000000a-000a-000a-000a-000000000398">
|
2
|
+
<name>ovirtmgmt</name>
|
3
|
+
<link href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398/permissions" rel="permissions"/>
|
4
|
+
<pass_through>
|
5
|
+
<mode>disabled</mode>
|
6
|
+
</pass_through>
|
7
|
+
<port_mirroring>false</port_mirroring>
|
8
|
+
<network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
|
9
|
+
<network_filter href="/ovirt-engine/api/networkfilters/593567f3-0314-011f-020e-0000000002d2" id="593567f3-0314-011f-020e-0000000002d2"/>
|
10
|
+
</vnic_profile>
|
data/lib/fog/ovirt/version.rb
CHANGED
@@ -2,7 +2,7 @@ Shindo.tests("Fog::Ovirt::Compute.new | client", ["ovirt"]) do
|
|
2
2
|
before do
|
3
3
|
@client_mock = Object.new
|
4
4
|
def @client_mock.foo
|
5
|
-
raise
|
5
|
+
raise ::Fog::Ovirt::Errors::OvirtError, "Test"
|
6
6
|
end
|
7
7
|
|
8
8
|
@object_under_test = Fog::Ovirt::Compute::ExceptionWrapper.new(@client_mock)
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ori Rabin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -298,6 +298,7 @@ files:
|
|
298
298
|
- lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml
|
299
299
|
- lib/fog/ovirt/requests/compute/v4/mock_files/vm.xml
|
300
300
|
- lib/fog/ovirt/requests/compute/v4/mock_files/vms.xml
|
301
|
+
- lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml
|
301
302
|
- lib/fog/ovirt/requests/compute/v4/mock_files/volumes.xml
|
302
303
|
- lib/fog/ovirt/requests/compute/v4/storage_domains.rb
|
303
304
|
- lib/fog/ovirt/requests/compute/v4/update_interface.rb
|