fog-ovirt 1.2.4 → 1.2.5

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: a62b31511ed1d6c8833b5b052d66f40ab39f9181e959aa9ad871b684e0a1ee08
4
- data.tar.gz: ca0a4d700f5fcc7e81dad02234fa3c2dedf4365f550e861771d59ca612c57889
3
+ metadata.gz: f7b24b23699c22d16d6f7a5da99f613ec7e7066022e5d6f0097fc15236745db8
4
+ data.tar.gz: e7f4357f8b657cd35625ebffe798cbc9bc09a65db3cb2aa6d5ec6f9706fad6c1
5
5
  SHA512:
6
- metadata.gz: e7d21ea96cb5f20f3e5d2e52733f5cddba61745637eada2876ed05f37a5410c285fcba02a710b06d312235df0272a3ab700f3ac77d473e8fe0c0ee8fbf19c37e
7
- data.tar.gz: 8dbbdbabe9a4b1bbf1d59a9b043e6569f1372fcb2e38acd4e6947a581f133f75349ca326b92016d4555fb72e5c55d4e880298200906a6f42f0f8a614c4db7216
6
+ metadata.gz: 805c36e9f5631026c94921b4278f1a193e5e52287a270e83a13c7bc1dfcdcd04a9588d76eb572ae5e2c632aba578acad499fd74a6bc3ca1965ac72ce72c37f9c
7
+ data.tar.gz: 83ce48a44a9f6952b18e8314551529e44cb7caf5df055dfdfb2402a4e976966f1191970538f8c5215f67ecf917c195ef464f841f931e8b2707d6077bf704ab52
@@ -21,3 +21,6 @@ Style/SignalException:
21
21
 
22
22
  Layout/EmptyLineAfterGuardClause:
23
23
  Enabled: false
24
+
25
+ Metrics/AbcSize:
26
+ Enabled: false
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ mock = ENV["FOG_MOCK"] || "true"
12
12
  begin
13
13
  require "rubocop/rake_task"
14
14
  RuboCop::RakeTask.new do |t|
15
- t.patterns = Dir["{lib,spec,tests}/**/*"]
15
+ t.patterns = Dir["{lib,spec,tests}/**/*.rb"]
16
16
  end
17
17
  rescue StandardError
18
18
  puts "Rubocop not loaded"
@@ -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
@@ -42,7 +42,7 @@ module Fog
42
42
  request :list_operating_systems
43
43
 
44
44
  module Shared
45
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
74
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
75
75
 
76
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
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?(:parent) && value.class.parent == OvirtSDK4
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
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/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
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?
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Ovirt
3
- VERSION = "1.2.4".freeze
3
+ VERSION = "1.2.5".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: 1.2.4
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: 2019-12-17 00:00:00.000000000 Z
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.3
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.