fog-ovirt 2.0.0 → 2.0.1

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
  SHA256:
3
- metadata.gz: '0018dbcebca7b9c47941e86933df6d71f9106c80348689ab8ff3e355c5bb550a'
4
- data.tar.gz: 312123f1ff82516363de62ed8cc2617117f3a8a9bd11cb655244332bbcf3b6dc
3
+ metadata.gz: 4cbc3f253a473c063a6f22507ecab2acb156f3be60d256184c7b2d024f4345f7
4
+ data.tar.gz: e7bccecc60f21d95f398fb99c8818c92c118d448b5d35da5ffb626eb7b67c14b
5
5
  SHA512:
6
- metadata.gz: b3218482b5f4b274c684c906688e59112ea1a67d78a437c89502840ab8a6edecdf5e311072cf8470f88c8752f31527e53e479924290b6f0323a73f3579d7ff27
7
- data.tar.gz: e5aa103e4a011613b64a86d2150a4a936d13e0f331bb287c404a912bcce618431d32ecb8d6ddb3c57b2b8c456840d89dd83fba1735663552eecbb27ed49cf77f
6
+ metadata.gz: 994e7f0826dde7c4fff25941e25065b098e3877493d5457a92edee03b7c951c993c4e4237a567b8e3c7c9091ededb0246c1b93ef363964b64e82dcf7ae22beb2
7
+ data.tar.gz: 0a8f71fd767765a45aff2524f2a4ea5467b84e6e66b7e7d8bf7efafa7a26ef87e05b9387d32823456efff68defba06203db36f58419705e23eb9581cc291566d
data/.gitignore CHANGED
@@ -19,6 +19,7 @@ doc/*
19
19
  docs/_site/*
20
20
  docs/about/supported_services.markdown
21
21
  Gemfile.lock
22
+ Gemfile.local.rb
22
23
  gemfiles/*.lock
23
24
  yardoc
24
25
  pkg
@@ -25,7 +25,6 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency("fog-json")
26
26
  spec.add_dependency("fog-xml")
27
27
  spec.add_dependency("ovirt-engine-sdk", ">= 4.3.1")
28
- spec.add_dependency("rbovirt", "~> 0.1.5")
29
28
 
30
29
  spec.add_development_dependency "bundler"
31
30
  spec.add_development_dependency "pry"
@@ -43,6 +43,7 @@ module Fog
43
43
  request :list_quotas
44
44
  request :get_quota
45
45
  request :list_operating_systems
46
+ request :list_vnic_profiles
46
47
 
47
48
  module Shared
48
49
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
@@ -9,6 +9,7 @@ module Fog
9
9
  attribute :network
10
10
  attribute :interface
11
11
  attribute :mac
12
+ attribute :vnic_profile
12
13
 
13
14
  def to_s
14
15
  name
@@ -9,19 +9,15 @@ module Fog
9
9
  nics_service = vm.nics_service
10
10
  options = options.dup
11
11
  options = convert_string_to_bool(options)
12
- if options[:network].present?
12
+ if options[:network].present? && options[:vnic_profile].nil?
13
13
  network = client.system_service.networks_service.network_service(options[:network]).get
14
-
15
14
  profiles = client.follow_link(network.vnic_profiles)
16
-
17
15
  profile = profiles.detect { |x| x.name == network.name }
18
-
19
16
  profile ||= profiles.min_by(&:name)
20
-
21
- options.delete(:network)
22
- options[:vnic_profile] = { :id => profile.id }
17
+ options[:vnic_profile] = profile.id
23
18
  end
24
-
19
+ options[:vnic_profile] = { :id => options[:vnic_profile] }
20
+ options.delete(:network)
25
21
  interface = OvirtSDK4::Nic.new(options)
26
22
  nics_service.add(interface)
27
23
  end
@@ -0,0 +1,25 @@
1
+ module Fog
2
+ module Ovirt
3
+ class Compute
4
+ class V4
5
+ class Real
6
+ def list_vnic_profiles(_opts = {})
7
+ dc_vnics = []
8
+ profiles = client.system_service.vnic_profiles_service.list
9
+ profiles.each do |profile|
10
+ vnic_network = client.follow_link(profile.network)
11
+ dc_vnics.append(profile) if vnic_network.data_center.id == datacenter
12
+ end
13
+ dc_vnics
14
+ end
15
+ end
16
+ class Mock
17
+ def list_vnic_profiles(_filters = {})
18
+ xml = read_xml "vnic_profiles.xml"
19
+ ovirt_attrs OvirtSDK4::Reader.read(Nokogiri::XML(xml).root.to_s)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,42 @@
1
+ <vnic_profiles>
2
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398" id="0000000a-000a-000a-000a-000000000398">
3
+ <name>ovirtmgmt</name>
4
+ <link href="/ovirt-engine/api/vnicprofiles/0000000a-000a-000a-000a-000000000398/permissions" rel="permissions"/>
5
+ <pass_through>
6
+ <mode>disabled</mode>
7
+ </pass_through>
8
+ <port_mirroring>false</port_mirroring>
9
+ <network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
10
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
11
+ </vnic_profile>
12
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/4e7431d7-bb74-4358-b065-7dc4a0a3f9a9" id="4e7431d7-bb74-4358-b065-7dc4a0a3f9a9">
13
+ <name>ovirtmgmt</name>
14
+ <link href="/ovirt-engine/api/vnicprofiles/4e7431d7-bb74-4358-b065-7dc4a0a3f9a9/permissions" rel="permissions"/>
15
+ <pass_through>
16
+ <mode>disabled</mode>
17
+ </pass_through>
18
+ <port_mirroring>false</port_mirroring>
19
+ <network href="/ovirt-engine/api/networks/f89cd192-657a-49aa-99ae-f325882eb70c" id="f89cd192-657a-49aa-99ae-f325882eb70c"/>
20
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
21
+ </vnic_profile>
22
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/51249f24-17d3-48e8-807e-689d85a22b14" id="51249f24-17d3-48e8-807e-689d85a22b14">
23
+ <name>test</name>
24
+ <link href="/ovirt-engine/api/vnicprofiles/51249f24-17d3-48e8-807e-689d85a22b14/permissions" rel="permissions"/>
25
+ <pass_through>
26
+ <mode>disabled</mode>
27
+ </pass_through>
28
+ <port_mirroring>true</port_mirroring>
29
+ <network href="/ovirt-engine/api/networks/f89cd192-657a-49aa-99ae-f325882eb70c" id="f89cd192-657a-49aa-99ae-f325882eb70c"/>
30
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
31
+ </vnic_profile>
32
+ <vnic_profile href="/ovirt-engine/api/vnicprofiles/8267104a-7597-474b-a617-9c787c1a8e9d" id="8267104a-7597-474b-a617-9c787c1a8e9d">
33
+ <name>fff</name>
34
+ <link href="/ovirt-engine/api/vnicprofiles/8267104a-7597-474b-a617-9c787c1a8e9d/permissions" rel="permissions"/>
35
+ <pass_through>
36
+ <mode>disabled</mode>
37
+ </pass_through>
38
+ <port_mirroring>false</port_mirroring>
39
+ <network href="/ovirt-engine/api/networks/00000000-0000-0000-0000-000000000009" id="00000000-0000-0000-0000-000000000009"/>
40
+ <network_filter href="/ovirt-engine/api/networkfilters/b295bf02-24b8-11ea-926f-001a4a160344" id="b295bf02-24b8-11ea-926f-001a4a160344"/>
41
+ </vnic_profile>
42
+ </vnic_profiles>
@@ -9,7 +9,7 @@ module Fog
9
9
  filter[:search] = create_search_by_datacenter(:search => filter[:search], :datacenter => datacenter_hash[:name])
10
10
  client.system_service.storage_domains_service.list(filter).collect do |sd|
11
11
  # Filter by role is not supported by the search language. The work around is to list all, then filter.
12
- role_filter.nil? || sd.type == role_filter ? sd : nil
12
+ role_filter.nil? || Array(role_filter).include?(sd.type) ? sd : nil
13
13
  end.compact
14
14
  end
15
15
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Ovirt
3
- VERSION = "2.0.0".freeze
3
+ VERSION = "2.0.1".freeze
4
4
  end
5
5
  end
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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ori Rabin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-13 00:00:00.000000000 Z
11
+ date: 2021-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -80,20 +80,6 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 4.3.1
83
- - !ruby/object:Gem::Dependency
84
- name: rbovirt
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: 0.1.5
90
- type: :runtime
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: 0.1.5
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: bundler
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -178,7 +164,6 @@ files:
178
164
  - CONTRIBUTING.md
179
165
  - CONTRIBUTORS.md
180
166
  - Gemfile
181
- - Gemfile.local.rb
182
167
  - LICENSE.md
183
168
  - README.md
184
169
  - Rakefile
@@ -230,6 +215,7 @@ files:
230
215
  - lib/fog/ovirt/requests/compute/v4/list_virtual_machines.rb
231
216
  - lib/fog/ovirt/requests/compute/v4/list_vm_interfaces.rb
232
217
  - lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb
218
+ - lib/fog/ovirt/requests/compute/v4/list_vnic_profiles.rb
233
219
  - lib/fog/ovirt/requests/compute/v4/list_volumes.rb
234
220
  - lib/fog/ovirt/requests/compute/v4/mock_files/affinitygroup.xml
235
221
  - lib/fog/ovirt/requests/compute/v4/mock_files/affinitygroup_vms.xml
@@ -250,6 +236,7 @@ files:
250
236
  - lib/fog/ovirt/requests/compute/v4/mock_files/vm.xml
251
237
  - lib/fog/ovirt/requests/compute/v4/mock_files/vms.xml
252
238
  - lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml
239
+ - lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profiles.xml
253
240
  - lib/fog/ovirt/requests/compute/v4/mock_files/volumes.xml
254
241
  - lib/fog/ovirt/requests/compute/v4/storage_domains.rb
255
242
  - lib/fog/ovirt/requests/compute/v4/update_interface.rb
File without changes