Files changed (128) hide show
  1. checksums.yaml +5 -5
  2. data/.rubocop_todo.yml +12 -5
  3. data/lib/fog/bin/ovirt.rb +3 -3
  4. data/lib/fog/ovirt.rb +3 -4
  5. data/lib/fog/ovirt/compute.rb +12 -12
  6. data/lib/fog/ovirt/compute/v3.rb +2 -2
  7. data/lib/fog/ovirt/compute/v4.rb +23 -4
  8. data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
  9. data/lib/fog/ovirt/models/compute/affinity_groups.rb +3 -3
  10. data/lib/fog/ovirt/models/compute/cluster.rb +2 -2
  11. data/lib/fog/ovirt/models/compute/clusters.rb +3 -3
  12. data/lib/fog/ovirt/models/compute/instance_type.rb +2 -2
  13. data/lib/fog/ovirt/models/compute/instance_types.rb +3 -3
  14. data/lib/fog/ovirt/models/compute/interface.rb +2 -2
  15. data/lib/fog/ovirt/models/compute/interfaces.rb +5 -5
  16. data/lib/fog/ovirt/models/compute/operating_system.rb +2 -2
  17. data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
  18. data/lib/fog/ovirt/models/compute/quota.rb +2 -2
  19. data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
  20. data/lib/fog/ovirt/models/compute/server.rb +4 -4
  21. data/lib/fog/ovirt/models/compute/servers.rb +3 -3
  22. data/lib/fog/ovirt/models/compute/template.rb +4 -4
  23. data/lib/fog/ovirt/models/compute/templates.rb +3 -3
  24. data/lib/fog/ovirt/models/compute/volume.rb +4 -4
  25. data/lib/fog/ovirt/models/compute/volumes.rb +5 -5
  26. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +2 -2
  27. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +2 -2
  28. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +2 -2
  29. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +2 -2
  30. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +2 -2
  31. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +2 -2
  32. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +2 -2
  33. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +2 -2
  34. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +2 -2
  35. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +2 -2
  36. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +2 -2
  37. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +2 -2
  38. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +2 -2
  39. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +2 -2
  40. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +2 -2
  41. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +2 -2
  42. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +2 -2
  43. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +2 -2
  44. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +2 -2
  45. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +2 -2
  46. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +2 -2
  47. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +2 -2
  48. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +2 -2
  49. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +2 -2
  50. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +2 -2
  51. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +2 -2
  52. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +2 -2
  53. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +3 -3
  54. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +2 -2
  55. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +2 -2
  56. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +2 -2
  57. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +2 -2
  58. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +2 -2
  59. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +2 -2
  60. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +2 -2
  61. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +2 -2
  62. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +2 -2
  63. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +4 -4
  64. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +2 -2
  65. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +4 -4
  66. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +2 -2
  67. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +2 -2
  68. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +2 -2
  69. data/lib/fog/ovirt/requests/compute/v4/add_interface.rb +3 -3
  70. data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +13 -16
  71. data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +20 -22
  72. data/lib/fog/ovirt/requests/compute/v4/datacenters.rb +2 -2
  73. data/lib/fog/ovirt/requests/compute/v4/destroy_interface.rb +2 -2
  74. data/lib/fog/ovirt/requests/compute/v4/destroy_vm.rb +2 -2
  75. data/lib/fog/ovirt/requests/compute/v4/destroy_volume.rb +2 -2
  76. data/lib/fog/ovirt/requests/compute/v4/get_api_version.rb +2 -2
  77. data/lib/fog/ovirt/requests/compute/v4/get_cluster.rb +2 -2
  78. data/lib/fog/ovirt/requests/compute/v4/get_instance_type.rb +2 -2
  79. data/lib/fog/ovirt/requests/compute/v4/get_quota.rb +2 -2
  80. data/lib/fog/ovirt/requests/compute/v4/get_template.rb +2 -2
  81. data/lib/fog/ovirt/requests/compute/v4/get_virtual_machine.rb +3 -3
  82. data/lib/fog/ovirt/requests/compute/v4/list_clusters.rb +2 -2
  83. data/lib/fog/ovirt/requests/compute/v4/list_instance_types.rb +2 -2
  84. data/lib/fog/ovirt/requests/compute/v4/list_networks.rb +2 -2
  85. data/lib/fog/ovirt/requests/compute/v4/list_operating_systems.rb +2 -2
  86. data/lib/fog/ovirt/requests/compute/v4/list_quotas.rb +2 -2
  87. data/lib/fog/ovirt/requests/compute/v4/list_template_interfaces.rb +2 -2
  88. data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +2 -2
  89. data/lib/fog/ovirt/requests/compute/v4/list_templates.rb +2 -2
  90. data/lib/fog/ovirt/requests/compute/v4/list_virtual_machines.rb +2 -2
  91. data/lib/fog/ovirt/requests/compute/v4/list_vm_interfaces.rb +2 -2
  92. data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +2 -2
  93. data/lib/fog/ovirt/requests/compute/v4/list_volumes.rb +2 -2
  94. data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +2 -2
  95. data/lib/fog/ovirt/requests/compute/v4/update_interface.rb +5 -4
  96. data/lib/fog/ovirt/requests/compute/v4/update_vm.rb +3 -2
  97. data/lib/fog/ovirt/requests/compute/v4/update_volume.rb +5 -5
  98. data/lib/fog/ovirt/requests/compute/v4/vm_action.rb +2 -2
  99. data/lib/fog/ovirt/requests/compute/v4/vm_start_with_cloudinit.rb +2 -2
  100. data/lib/fog/ovirt/requests/compute/v4/vm_ticket.rb +4 -3
  101. data/lib/fog/ovirt/version.rb +1 -1
  102. data/tests/ovirt/compute_tests.rb +2 -2
  103. data/tests/ovirt/models/compute/cluster_tests.rb +3 -3
  104. data/tests/ovirt/models/compute/clusters_tests.rb +3 -3
  105. data/tests/ovirt/models/compute/interface_tests.rb +3 -3
  106. data/tests/ovirt/models/compute/interfaces_tests.rb +3 -3
  107. data/tests/ovirt/models/compute/operating_system_tests.rb +3 -3
  108. data/tests/ovirt/models/compute/operating_systems_tests.rb +3 -3
  109. data/tests/ovirt/models/compute/server_tests.rb +3 -3
  110. data/tests/ovirt/models/compute/servers_tests.rb +3 -3
  111. data/tests/ovirt/models/compute/template_tests.rb +3 -3
  112. data/tests/ovirt/models/compute/templates_tests.rb +3 -3
  113. data/tests/ovirt/requests/compute/v3/client_tests.rb +2 -2
  114. data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +2 -2
  115. data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +2 -2
  116. data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +2 -2
  117. data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +2 -2
  118. data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +2 -2
  119. data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +2 -2
  120. data/tests/ovirt/requests/compute/v3/update_volume_tests.rb +2 -2
  121. data/tests/ovirt/requests/compute/v4/client_tests.rb +2 -2
  122. data/tests/ovirt/requests/compute/v4/create_vm_tests.rb +2 -2
  123. data/tests/ovirt/requests/compute/v4/destroy_vm_tests.rb +2 -2
  124. data/tests/ovirt/requests/compute/v4/list_datacenters_tests.rb +1 -1
  125. data/tests/ovirt/requests/compute/v4/list_quotas_tests.rb +1 -1
  126. data/tests/ovirt/requests/compute/v4/list_storage_domains_tests.rb +1 -1
  127. data/tests/ovirt/requests/compute/v4/update_volume_tests.rb +1 -1
  128. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
- SHA1:
3
- metadata.gz: 2e47fa7e306962a88299505ea5723bf4374c3f1c
4
- data.tar.gz: 9cc07868f6ed1a2f8dd5a96f93c62d4b4b8650df
2
+ SHA256:
3
+ metadata.gz: 8782e80f74881843f3d5cfdf3537289c1f828190f9285905989d75f486252d13
4
+ data.tar.gz: b9088bc35338d04d9b6408ad91ff11db4623a998ca84346e2bce9c726b449e28
5
5
SHA512:
6
- metadata.gz: 3aa5058b8381d5859cb654a192c30e1067722f435f9acbca22dce5763b42518ab6d0ac30f4f1def9f6ac768a7a0d384f6551618da679e7d7e462d99cdacf71ca
7
- data.tar.gz: 296fe2cff9e9e6fa0e9b0e93e86ecc2bdb32897152a2acd7ba5a5947bde8d8504fee2861e3414d91d4a4561bf2ffc5a91131e08d3c643a29aff4aab0068f12b6
6
+ metadata.gz: b25cf3dc201edb0a1b53fadab1d10182d3a7de3ecd26fed18c1e3c19ccad9d2855465f6e8e4f551aa4fcb685058db544e9baf730a90934bb7968e2dda3b770ca
7
+ data.tar.gz: e2423a8441309249034df7311e1884265fc5a1c747e3d3f20cb3a182747b8626d3137dd73b23bf02c589af499377a05f318fe8616a242db9f5a31a9f30a5a0a7
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
# This configuration was generated by
2
2
# `rubocop --auto-gen-config`
3
- # on 2017-12-14 14:56:02 +0100 using RuboCop version 0.52.0.
3
+ # on 2019-05-22 10:36:37 +0300 using RuboCop version 0.70.0.
4
4
# The point is for the user to remove these configuration records
5
5
# one by one as the offenses are removed from the code base.
6
6
# Note that changes in the inspected code, or installation of new
@@ -11,10 +11,10 @@
11
11
Metrics/ClassLength:
12
12
Max: 150
13
13
14
- # Offense count: 2
15
- # Configuration parameters: CountComments.
14
+ # Offense count: 10
15
+ # Configuration parameters: CountComments, ExcludedMethods.
16
16
Metrics/MethodLength:
17
- Max: 30
17
+ Max: 26
18
18
19
19
# Offense count: 1
20
20
Style/ClassVars:
@@ -26,7 +26,7 @@ Style/CommentedKeyword:
26
26
Exclude:
27
27
- 'lib/fog/ovirt/models/compute/server.rb'
28
28
29
- # Offense count: 113
29
+ # Offense count: 188
30
30
Style/Documentation:
31
31
Enabled: false
32
32
@@ -36,6 +36,13 @@ Style/DoubleNegation:
36
36
- 'lib/fog/ovirt/models/compute/server.rb'
37
37
- 'tests/helpers/succeeds_helper.rb'
38
38
39
+ # Offense count: 133
40
+ # Cop supports --auto-correct.
41
+ # Configuration parameters: EnforcedStyle.
42
+ # SupportedStyles: always, never
43
+ Style/FrozenStringLiteralComment:
44
+ Enabled: false
45
+
39
46
# Offense count: 4
40
47
Style/MultilineTernaryOperator:
41
48
Exclude:
data/lib/fog/bin/ovirt.rb CHANGED
@@ -1,9 +1,9 @@
1
- class Ovirt < Fog::Bin
1
+ class Compute < Fog::Bin
2
2
class << self
3
3
def class_for(key)
4
4
case key
5
5
when :compute
6
- Fog::Compute::Ovirt
6
+ Fog::Ovirt::Compute
7
7
else
8
8
raise ArgumentError, "Unrecognized service: #{key}"
9
9
end
@@ -13,7 +13,7 @@ class Ovirt < Fog::Bin
13
13
@@connections ||= Hash.new do |hash, key|
14
14
hash[key] = case key
15
15
when :compute
16
- Fog::Compute.new(:provider => "Ovirt")
16
+ Fog::Ovirt::Compute.new
17
17
else
18
18
raise ArgumentError, "Unrecognized service: #{key.inspect}"
19
19
end
data/lib/fog/ovirt.rb CHANGED
@@ -1,12 +1,11 @@
1
1
require "fog/core"
2
2
require "fog/xml"
3
+ require "fog/json"
3
4
4
5
module Fog
5
- module Compute
6
- autoload :Ovirt, File.expand_path("ovirt/compute", __dir__)
7
- end
8
-
9
6
module Ovirt
7
+ autoload :Compute, "fog/ovirt/compute"
8
+
10
9
extend Fog::Provider
11
10
12
11
module Errors
data/lib/fog/ovirt/compute.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt < Fog::Service
2
+ module Ovirt
3
+ class Compute < Fog::Service
4
4
recognizes :api_version, :ovirt_username, :ovirt_password, :ovirt_url,
5
5
:ovirt_datacenter, :ovirt_ca_cert_store, :public_key
6
6
@@ -58,9 +58,9 @@ module Fog
58
58
59
59
# rubocop:disable Style/ConditionalAssignment
60
60
if options[:api_version] == "v4"
61
- @client = Fog::Compute::Ovirt::V4.new(options)
61
+ @client = Fog::Ovirt::Compute::V4.new(options)
62
62
else
63
- @client = Fog::Compute::Ovirt::V3.new(options)
63
+ @client = Fog::Ovirt::Compute::V3.new(options)
64
64
end
65
65
# rubocop:enable Style/ConditionalAssignment
66
66
end
@@ -78,11 +78,11 @@ module Fog
78
78
class Mock
79
79
def initialize(options = {})
80
80
if options[:api_version] == "v4"
81
- Fog::Compute::Ovirt::V4::Mock.send(:include, Fog::Compute::Ovirt::Collections)
82
- @client = Fog::Compute::Ovirt::V4::Mock.new(options)
81
+ Fog::Ovirt::Compute::V4::Mock.send(:include, Fog::Ovirt::Compute::Collections)
82
+ @client = Fog::Ovirt::Compute::V4::Mock.new(options)
83
83
else
84
- Fog::Compute::Ovirt::V3::Mock.send(:include, Fog::Compute::Ovirt::Collections)
85
- @client = Fog::Compute::Ovirt::V3::Mock.new(options)
84
+ Fog::Ovirt::Compute::V3::Mock.send(:include, Fog::Ovirt::Compute::Collections)
85
+ @client = Fog::Ovirt::Compute::V3::Mock.new(options)
86
86
end
87
87
end
88
88
@@ -100,11 +100,11 @@ module Fog
100
100
class Real
101
101
def initialize(options = {})
102
102
if options[:api_version] == "v4"
103
- Fog::Compute::Ovirt::V4::Real.send(:include, Fog::Compute::Ovirt::Collections)
104
- @client = Fog::Compute::Ovirt::V4::Real.new(options)
103
+ Fog::Ovirt::Compute::V4::Real.send(:include, Fog::Ovirt::Compute::Collections)
104
+ @client = Fog::Ovirt::Compute::V4::Real.new(options)
105
105
else
106
- Fog::Compute::Ovirt::V3::Real.send(:include, Fog::Compute::Ovirt::Collections)
107
- @client = Fog::Compute::Ovirt::V3::Real.new(options)
106
+ Fog::Ovirt::Compute::V3::Real.send(:include, Fog::Ovirt::Compute::Collections)
107
+ @client = Fog::Ovirt::Compute::V3::Real.new(options)
108
108
end
109
109
end
110
110
data/lib/fog/ovirt/compute/v3.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3 < Fog::Service
5
5
requires :ovirt_username, :ovirt_password
6
6
recognizes :ovirt_url, :ovirt_server, :ovirt_port, :ovirt_api_path, :ovirt_datacenter,
data/lib/fog/ovirt/compute/v4.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4 < Fog::Service
5
5
requires :ovirt_username, :ovirt_password
6
6
recognizes :ovirt_url, :ovirt_server, :ovirt_port, :ovirt_api_path, :ovirt_datacenter,
@@ -51,7 +51,7 @@ module Fog
51
51
value = obj.instance_variable_get(v)
52
52
53
53
if key == :network
54
- opts[key] = client.follow_link(obj.vnic_profile).network.id
54
+ opts[key] = obj.vnic_profile.present? ? client.follow_link(obj.vnic_profile).network.id : value
55
55
next
56
56
end
57
57
@@ -76,7 +76,7 @@ module Fog
76
76
case value
77
77
when OvirtSDK4::List
78
78
value.to_a
79
- when Array, Hash, DateTime, TrueClass, FalseClass
79
+ when Array, Hash, DateTime
80
80
value
81
81
when OvirtSDK4::HighAvailability
82
82
opts[:ha] = value.enabled
@@ -95,9 +95,12 @@ module Fog
95
95
:address => value.address,
96
96
:port => value.port,
97
97
:secure_port => value.secure_port,
98
+ :keyboard_layout => value.keyboard_layout,
98
99
:subject => subject,
99
100
:monitors => value.monitors
100
101
}
102
+ when OvirtSDK4::Console
103
+ { :enabled => value.enabled }
101
104
else
102
105
if value.class.respond_to?(:parent) && value.class.parent == OvirtSDK4
103
106
value.id if value.respond_to?(:id)
@@ -107,6 +110,22 @@ module Fog
107
110
end
108
111
end
109
112
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
113
+
114
+ def convert_string_to_bool(opts)
115
+ return opts unless opts.present?
116
+ opts.each do |key, value|
117
+ if value == "true"
118
+ opts[key] = true
119
+ elsif value == "false"
120
+ opts[key] = false
121
+ elsif value.is_a? Hash
122
+ convert_string_to_bool(value)
123
+ elsif value.is_a? Array
124
+ value.map { |item| convert_string_to_bool(item) }
125
+ end
126
+ end
127
+ opts
128
+ end
110
129
end
111
130
112
131
class Mock
data/lib/fog/ovirt/models/compute/affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class AffinityGroup < Fog::Model
5
5
identity :id
6
6
data/lib/fog/ovirt/models/compute/affinity_groups.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/affinity_group"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class AffinityGroups < Fog::Collection
8
- model Fog::Compute::Ovirt::AffinityGroup
8
+ model Fog::Ovirt::Compute::AffinityGroup
9
9
10
10
def all(filters = {})
11
11
load service.list_affinity_groups(filters)
data/lib/fog/ovirt/models/compute/cluster.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class Cluster < Fog::Model
5
5
identity :id
6
6
data/lib/fog/ovirt/models/compute/clusters.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/cluster"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Clusters < Fog::Collection
8
- model Fog::Compute::Ovirt::Cluster
8
+ model Fog::Ovirt::Compute::Cluster
9
9
10
10
def all(filters = {})
11
11
load service.list_clusters(filters)
data/lib/fog/ovirt/models/compute/instance_type.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class InstanceType < Fog::Model
5
5
identity :id
6
6
data/lib/fog/ovirt/models/compute/instance_types.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/instance_type"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class InstanceTypes < Fog::Collection
8
- model Fog::Compute::Ovirt::InstanceType
8
+ model Fog::Ovirt::Compute::InstanceType
9
9
10
10
def all(filters = {})
11
11
load service.list_instance_types(filters)
data/lib/fog/ovirt/models/compute/interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class Interface < Fog::Model
5
5
attr_accessor :raw
6
6
identity :id
data/lib/fog/ovirt/models/compute/interfaces.rb CHANGED
@@ -2,19 +2,19 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/interface"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Interfaces < Fog::Collection
8
- model Fog::Compute::Ovirt::Interface
8
+ model Fog::Ovirt::Compute::Interface
9
9
10
10
attr_accessor :vm
11
11
12
12
# rubocop:disable Metrics/AbcSize
13
13
def all(_filters = {})
14
14
requires :vm
15
- if vm.is_a? Fog::Compute::Ovirt::Server
15
+ if vm.is_a? Fog::Ovirt::Compute::Server
16
16
load service.list_vm_interfaces(vm.id)
17
- elsif vm.is_a? Fog::Compute::Ovirt::Template
17
+ elsif vm.is_a? Fog::Ovirt::Compute::Template
18
18
load service.list_template_interfaces(vm.id)
19
19
else
20
20
raise ::Fog::Ovirt::Errors::OvirtError, "interfaces should have vm or template"
data/lib/fog/ovirt/models/compute/operating_system.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class OperatingSystem < Fog::Model
5
5
attr_accessor :raw
6
6
identity :id
data/lib/fog/ovirt/models/compute/operating_systems.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/operating_system"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class OperatingSystems < Fog::Collection
8
- model Fog::Compute::Ovirt::OperatingSystem
8
+ model Fog::Ovirt::Compute::OperatingSystem
9
9
10
10
def all
11
11
load service.list_operating_systems
data/lib/fog/ovirt/models/compute/quota.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class Quota < Fog::Model
5
5
identity :id
6
6
data/lib/fog/ovirt/models/compute/quotas.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/quota"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Quotas < Fog::Collection
8
- model Fog::Compute::Ovirt::Quota
8
+ model Fog::Ovirt::Compute::Quota
9
9
10
10
def all(filters = {})
11
11
load service.list_quotas(filters)
data/lib/fog/ovirt/models/compute/server.rb CHANGED
@@ -1,8 +1,8 @@
1
1
require "fog/compute/models/server"
2
2
3
3
module Fog
4
- module Compute
5
- class Ovirt
4
+ module Ovirt
5
+ class Compute
6
6
class Server < Fog::Compute::Server
7
7
# This will be the instance uuid which is globally unique across
8
8
# a oVirt deployment.
@@ -53,7 +53,7 @@ module Fog
53
53
end
54
54
55
55
def interfaces
56
- @interfaces ||= id.nil? ? [] : Fog::Compute::Ovirt::Interfaces.new(
56
+ @interfaces ||= id.nil? ? [] : Fog::Ovirt::Compute::Interfaces.new(
57
57
:service => service,
58
58
:vm => self
59
59
)
@@ -75,7 +75,7 @@ module Fog
75
75
end
76
76
77
77
def volumes
78
- @volumes ||= id.nil? ? [] : Fog::Compute::Ovirt::Volumes.new(
78
+ @volumes ||= id.nil? ? [] : Fog::Ovirt::Compute::Volumes.new(
79
79
:service => service,
80
80
:vm => self
81
81
)
data/lib/fog/ovirt/models/compute/servers.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/server"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Servers < Fog::Collection
8
- model Fog::Compute::Ovirt::Server
8
+ model Fog::Ovirt::Compute::Server
9
9
10
10
def all(filters = {})
11
11
load service.list_virtual_machines(filters)
data/lib/fog/ovirt/models/compute/template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class Template < Fog::Model
5
5
identity :id
6
6
@@ -23,14 +23,14 @@ module Fog
23
23
attribute :version
24
24
25
25
def interfaces
26
- attributes[:interfaces] ||= id.nil? ? [] : Fog::Compute::Ovirt::Interfaces.new(
26
+ attributes[:interfaces] ||= id.nil? ? [] : Fog::Ovirt::Compute::Interfaces.new(
27
27
:service => service,
28
28
:vm => self
29
29
)
30
30
end
31
31
32
32
def volumes
33
- attributes[:volumes] ||= id.nil? ? [] : Fog::Compute::Ovirt::Volumes.new(
33
+ attributes[:volumes] ||= id.nil? ? [] : Fog::Ovirt::Compute::Volumes.new(
34
34
:service => service,
35
35
:vm => self
36
36
)
data/lib/fog/ovirt/models/compute/templates.rb CHANGED
@@ -2,10 +2,10 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/template"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Templates < Fog::Collection
8
- model Fog::Compute::Ovirt::Template
8
+ model Fog::Ovirt::Compute::Template
9
9
10
10
def all(filters = {})
11
11
load service.list_templates(filters)
data/lib/fog/ovirt/models/compute/volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class Volume < Fog::Model
5
5
attr_accessor :raw
6
6
identity :id
@@ -19,11 +19,11 @@ module Fog
19
19
attribute :wipe_after_delete
20
20
21
21
def size_gb
22
- attributes[:size_gb] ||= attributes[:size].to_i / Fog::Compute::Ovirt::DISK_SIZE_TO_GB if attributes[:size]
22
+ attributes[:size_gb] ||= attributes[:size].to_i / Fog::Ovirt::Compute::DISK_SIZE_TO_GB if attributes[:size]
23
23
end
24
24
25
25
def size_gb=(size)
26
- attributes[:size] = size.to_i * Fog::Compute::Ovirt::DISK_SIZE_TO_GB if size
26
+ attributes[:size] = size.to_i * Fog::Ovirt::Compute::DISK_SIZE_TO_GB if size
27
27
end
28
28
29
29
def to_s
data/lib/fog/ovirt/models/compute/volumes.rb CHANGED
@@ -2,18 +2,18 @@ require "fog/core/collection"
2
2
require "fog/ovirt/models/compute/volume"
3
3
4
4
module Fog
5
- module Compute
6
- class Ovirt
5
+ module Ovirt
6
+ class Compute
7
7
class Volumes < Fog::Collection
8
- model Fog::Compute::Ovirt::Volume
8
+ model Fog::Ovirt::Compute::Volume
9
9
10
10
attr_accessor :vm
11
11
12
12
# rubocop:disable Metrics/AbcSize
13
13
def all(_filters = {})
14
- if vm.is_a? Fog::Compute::Ovirt::Server
14
+ if vm.is_a? Fog::Ovirt::Compute::Server
15
15
load service.list_vm_volumes(vm.id)
16
- elsif vm.is_a? Fog::Compute::Ovirt::Template
16
+ elsif vm.is_a? Fog::Ovirt::Compute::Template
17
17
load service.list_template_volumes(vm.id)
18
18
else
19
19
load service.list_volumes
data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def activate_volume(id, options)
data/lib/fog/ovirt/requests/compute/v3/add_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def add_interface(id, options = {})
data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def add_to_affinity_group(id, options = {})
data/lib/fog/ovirt/requests/compute/v3/add_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
DISK_SIZE_TO_GB = 1_073_741_824
data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def attach_volume(id, options)
data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def create_affinity_group(attrs)
data/lib/fog/ovirt/requests/compute/v3/create_vm.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def create_vm(attrs)
data/lib/fog/ovirt/requests/compute/v3/datacenters.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def datacenters(filter = {})
data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def deactivate_volume(id, options)
data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def destroy_affinity_group(id)
data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def destroy_interface(id, options)
data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def destroy_vm(options = {})
data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def destroy_volume(id, options)
data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def detach_volume(id, options)
data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_affinity_group(id)
data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def api_version
data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_cluster(id)
data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_instance_type(id)
data/lib/fog/ovirt/requests/compute/v3/get_quota.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_quota(id)
data/lib/fog/ovirt/requests/compute/v3/get_template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_template(id)
data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def get_virtual_machine(id)
data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_affinity_group_vms(id)
data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_affinity_groups(filters = {})
data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_clusters(filters = {})
data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_instance_types(filters = {})
data/lib/fog/ovirt/requests/compute/v3/list_networks.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_networks(cluster_id)
data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_operating_systems
data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_quotas(filters = {})
@@ -11,7 +11,7 @@ module Fog
11
11
def list_quotas(_filters = {})
12
12
xml = read_xml "quotas.xml"
13
13
Nokogiri::XML(xml).xpath("/quotas/quota").map do |q|
14
- ovirt_attrs OVIRT::Quotas.new(self, q)
14
+ ovirt_attrs OVIRT::Quota.new(self, q)
15
15
end
16
16
end
17
17
end
data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_template_interfaces(vm_id)
data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_template_volumes(template_id)
data/lib/fog/ovirt/requests/compute/v3/list_templates.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_templates(filters = {})
data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_virtual_machines(filters = {})
data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_vm_interfaces(vm_id)
data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_vm_volumes(vm_id)
data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def list_volumes
data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def remove_from_affinity_group(id, options = {})
data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def storage_domains(filter = {})
data/lib/fog/ovirt/requests/compute/v3/update_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
module Shared
6
6
def check_arguments(id, options)
@@ -10,7 +10,7 @@ module Fog
10
10
end
11
11
12
12
class Real
13
- extend ::Fog::Compute::Ovirt::V3::Shared
13
+ extend ::Fog::Ovirt::Compute::V3::Shared
14
14
15
15
def update_interface(id, options)
16
16
check_arguments(id, options)
@@ -23,7 +23,7 @@ module Fog
23
23
end
24
24
25
25
class Mock
26
- extend ::Fog::Compute::Ovirt::V3::Shared
26
+ extend ::Fog::Ovirt::Compute::V3::Shared
27
27
28
28
def update_interface(id, options)
29
29
check_arguments(id, options)
data/lib/fog/ovirt/requests/compute/v3/update_vm.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def update_vm(attrs)
data/lib/fog/ovirt/requests/compute/v3/update_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
module Shared
6
6
def check_arguments(id, options)
@@ -10,7 +10,7 @@ module Fog
10
10
end
11
11
12
12
class Real
13
- extend ::Fog::Compute::Ovirt::V3::Shared
13
+ extend ::Fog::Ovirt::Compute::V3::Shared
14
14
15
15
def update_volume(id, options)
16
16
check_arguments(id, options)
@@ -24,7 +24,7 @@ module Fog
24
24
end
25
25
26
26
class Mock
27
- extend ::Fog::Compute::Ovirt::V3::Shared
27
+ extend ::Fog::Ovirt::Compute::V3::Shared
28
28
29
29
def update_volume(id, options)
30
30
check_arguments(id, options)
data/lib/fog/ovirt/requests/compute/v3/vm_action.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def vm_action(options = {})
data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def vm_start_with_cloudinit(options = {})
data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V3
5
5
class Real
6
6
def vm_ticket(id, options = {})
data/lib/fog/ovirt/requests/compute/v4/add_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
# rubocop:disable Metrics/AbcSize
@@ -9,7 +9,7 @@ module Fog
9
9
vm = client.system_service.vms_service.vm_service(id)
10
10
nics_service = vm.nics_service
11
11
options = options.dup
12
-
12
+ options = convert_string_to_bool(options)
13
13
if options[:network].present?
14
14
network = client.system_service.networks_service.network_service(options[:network]).get
15
15
data/lib/fog/ovirt/requests/compute/v4/add_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def add_volume(id, options = {})
@@ -13,32 +13,29 @@ module Fog
13
13
disk_attachments_service.add(disk)
14
14
end
15
15
16
- # rubocop:disable Metrics/AbcSize
16
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
17
17
def add_options_defaults(options)
18
18
options = options.dup
19
- search = options[:search] || format("datacenter=%<datacenter>s", :datacenter => datacenter)
20
- options[:bootable] = options.delete(:bootable) == "true"
19
+ options = convert_string_to_bool(options)
20
+ options[:bootable] = options.delete(:bootable)
21
21
options[:interface] ||= OvirtSDK4::DiskInterface::VIRTIO
22
- options[:provisioned_size] = options[:size_gb].to_i * Fog::Compute::Ovirt::DISK_SIZE_TO_GB if options[:size_gb]
23
-
24
- options[:storage_domain_id] = options[:storage_domain] || storagedomains(:role => "data", :search => search).first.id
22
+ options[:provisioned_size] = options[:size_gb].to_i * Fog::Ovirt::Compute::DISK_SIZE_TO_GB if options[:size_gb]
23
+ options[:sparse] = true if options[:sparse].nil?
24
+ options[:storage_domain_id] = options[:storage_domain] if options[:storage_domain]
25
25
# If no size is given, default to a volume size of 8GB
26
- options[:provisioned_size] ||= 8 * Fog::Compute::Ovirt::DISK_SIZE_TO_GB
26
+ options[:provisioned_size] ||= 8 * Fog::Ovirt::Compute::DISK_SIZE_TO_GB
27
27
options[:type] ||= OvirtSDK4::DiskType::DATA
28
28
options[:format] ||= OvirtSDK4::DiskFormat::COW
29
-
30
- options[:sparse] = true unless options[:sparse].present?
31
29
options[:quota] = options[:quota].present? ? client.system_service.data_centers_service.data_center_service(datacenter).quotas_service.quota_service(options[:quota]).get : nil
32
-
33
30
options[:disk] ||= {}
34
- options[:disk][:storage_domains] ||= [client.system_service.storage_domains_service.storage_domain_service(options[:storage_domain_id]).get]
31
+ options[:disk][:sparse] = options.delete(:sparse) if options[:disk][:sparse].nil?
32
+ options[:disk][:storage_domains] ||= [client.system_service.storage_domains_service.storage_domain_service(options[:storage_domain_id]).get] if options[:storage_domain_id]
35
33
options[:disk][:provisioned_size] ||= options.delete(:provisioned_size)
36
34
options[:disk][:format] ||= options.delete(:format)
37
- options[:disk][:sparse] ||= options.delete(:sparse)
35
+ options[:disk][:wipe_after_delete] = options.delete(:wipe_after_delete) if options[:disk][:wipe_after_delete].nil?
38
- options[:disk][:wipe_after_delete] ||= options.delete(:wipe_after_delete)
39
36
options
40
37
end
41
- # rubocop:enable Metrics/AbcSize
38
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
42
39
end
43
40
44
41
class Mock
data/lib/fog/ovirt/requests/compute/v4/create_vm.rb CHANGED
@@ -1,32 +1,30 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
- def check_for_option(opts, name)
7
- opts[name.to_sym] || opts[(name + "_name").to_sym]
6
+ def create_disk_attachment_from_disk(disk_to_attachment)
7
+ storage_domain = client.system_service.storage_domains_service.storage_domain_service(disk_to_attachment["storage_domain"]).get
8
- end
9
-
10
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
11
- def process_vm_opts(opts)
12
- return unless check_for_option(opts, "template") && check_for_option(opts, "storagedomain")
13
8
14
- template_id = opts[:template] || client.system_service.templates_service.search(:name => opts[:template_name]).first.id
15
- template_disks = client.system_service.templates_service.template_service(template_id).get.disk_attachments
16
- storagedomain_id = opts[:storagedomain] || storagedomains.select { |s| s.name == opts[:storagedomain_name] }.first.id
9
+ disk = {
10
+ :id => disk_to_attachment["id"],
11
+ :format => disk_to_attachment.fetch("format", OvirtSDK4::DiskFormat::COW),
12
+ :sparse => disk_to_attachment.fetch("sparse", true),
13
+ :storage_domains => [storage_domain]
14
+ }
17
15
18
- # Make sure the 'clone' option is set if any of the disks defined by
19
- # the template is stored on a different storage domain than requested
16
+ OvirtSDK4::DiskAttachment.new(:disk => disk)
17
+ end
20
- opts[:clone] = true unless opts[:clone] == true || template_disks.empty? || template_disks.all? { |d| d.storage_domain == storagedomain_id }
21
18
22
- # Create disks map
23
- opts[:disks] = template_disks.collect { |d| { :id => d.id, :storagedomain => storagedomain_id } }
19
+ def process_vm_disks(opts)
20
+ opts[:disk_attachments] = opts[:disks].map { |disk| create_disk_attachment_from_disk(disk) }
21
+ opts.delete(:disks)
24
22
end
25
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
26
23
27
24
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
28
25
def create_vm(attrs)
29
26
attrs = attrs.dup
27
+ attrs = convert_string_to_bool(attrs)
30
28
31
29
if attrs[:cluster].present?
32
30
attrs[:cluster] = client.system_service.clusters_service.cluster_service(attrs[:cluster]).get
@@ -57,13 +55,13 @@ module Fog
57
55
cpu_topology = OvirtSDK4::CpuTopology.new(:cores => attrs.fetch(:cores, "1"), :sockets => attrs.fetch(:sockets, "1"))
58
56
attrs[:cpu] = OvirtSDK4::Cpu.new(:topology => cpu_topology)
59
57
end
60
- attrs[:memory_policy] = OvirtSDK4::MemoryPolicy.new(:guaranteed => attrs[:memory]) if attrs[:memory].to_i < Fog::Compute::Ovirt::DISK_SIZE_TO_GB
58
+ attrs[:memory_policy] = OvirtSDK4::MemoryPolicy.new(:guaranteed => attrs[:memory]) if attrs[:memory].to_i < Fog::Ovirt::Compute::DISK_SIZE_TO_GB
61
59
attrs[:high_availability] = OvirtSDK4::HighAvailability.new(:enabled => attrs[:ha] == "1") if attrs[:ha].present?
62
60
63
- # TODO: handle cloning from template
64
- process_vm_opts(attrs)
61
+ process_vm_disks(attrs) if attrs[:clone] == true && attrs[:disks].present?
62
+
65
63
new_vm = OvirtSDK4::Vm.new(attrs)
66
- vms_service.add(new_vm)
64
+ vms_service.add(new_vm, :clone => attrs[:clone])
67
65
end
68
66
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/MethodLength
69
67
data/lib/fog/ovirt/requests/compute/v4/datacenters.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def datacenters(filter = {})
data/lib/fog/ovirt/requests/compute/v4/destroy_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def destroy_interface(id, options)
data/lib/fog/ovirt/requests/compute/v4/destroy_vm.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def destroy_vm(options = {})
data/lib/fog/ovirt/requests/compute/v4/destroy_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def destroy_volume(id, options)
data/lib/fog/ovirt/requests/compute/v4/get_api_version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def api_version
data/lib/fog/ovirt/requests/compute/v4/get_cluster.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def get_cluster(id)
data/lib/fog/ovirt/requests/compute/v4/get_instance_type.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def get_instance_type(id)
data/lib/fog/ovirt/requests/compute/v4/get_quota.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def get_quota(id)
data/lib/fog/ovirt/requests/compute/v4/get_template.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def get_template(id)
data/lib/fog/ovirt/requests/compute/v4/get_virtual_machine.rb CHANGED
@@ -1,10 +1,10 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def get_virtual_machine(id)
7
- ovirt_attrs client.system_service.vms_service.vm_service(id).get
7
+ ovirt_attrs client.system_service.vms_service.vm_service(id).get(:all_content => true)
8
8
end
9
9
end
10
10
class Mock
data/lib/fog/ovirt/requests/compute/v4/list_clusters.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_clusters(opts = {})
data/lib/fog/ovirt/requests/compute/v4/list_instance_types.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_instance_types(filters = {})
data/lib/fog/ovirt/requests/compute/v4/list_networks.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_networks(cluster_id)
data/lib/fog/ovirt/requests/compute/v4/list_operating_systems.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_operating_systems
data/lib/fog/ovirt/requests/compute/v4/list_quotas.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_quotas(filters = {})
data/lib/fog/ovirt/requests/compute/v4/list_template_interfaces.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_template_interfaces(vm_id)
data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
# rubocop:disable Metrics/AbcSize
data/lib/fog/ovirt/requests/compute/v4/list_templates.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_templates(filters = {})
data/lib/fog/ovirt/requests/compute/v4/list_virtual_machines.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_virtual_machines(filters = {})
data/lib/fog/ovirt/requests/compute/v4/list_vm_interfaces.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_vm_interfaces(vm_id)
data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
# rubocop:disable Metrics/AbcSize
data/lib/fog/ovirt/requests/compute/v4/list_volumes.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def list_volumes
data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def storage_domains(filter = {})
data/lib/fog/ovirt/requests/compute/v4/update_interface.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
module Shared
6
6
def check_arguments(id, options)
@@ -10,9 +10,10 @@ module Fog
10
10
end
11
11
12
12
class Real
13
- extend ::Fog::Compute::Ovirt::V4::Shared
13
+ extend ::Fog::Ovirt::Compute::V4::Shared
14
14
15
15
def update_interface(id, options)
16
+ options = convert_string_to_bool(options)
16
17
check_arguments(id, options)
17
18
18
19
interface_id = options[:id]
@@ -22,7 +23,7 @@ module Fog
22
23
end
23
24
24
25
class Mock
25
- extend ::Fog::Compute::Ovirt::V4::Shared
26
+ extend ::Fog::Ovirt::Compute::V4::Shared
26
27
27
28
def update_interface(id, options)
28
29
check_arguments(id, options)
data/lib/fog/ovirt/requests/compute/v4/update_vm.rb CHANGED
@@ -1,11 +1,12 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
# rubocop:disable Metrics/AbcSize
7
7
def update_vm(attrs)
8
8
attrs = attrs.dup
9
+ attrs = convert_string_to_bool(attrs)
9
10
vm_service = client.system_service.vms_service.vm_service(attrs[:id])
10
11
11
12
if attrs[:cores].present?
data/lib/fog/ovirt/requests/compute/v4/update_volume.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
module Shared
6
6
def check_arguments(id, options)
@@ -10,11 +10,11 @@ module Fog
10
10
end
11
11
12
12
class Real
13
- extend ::Fog::Compute::Ovirt::V4::Shared
13
+ extend ::Fog::Ovirt::Compute::V4::Shared
14
14
15
15
def update_volume(id, options)
16
16
check_arguments(id, options)
17
-
17
+ options = convert_string_to_bool(options)
18
18
disk_id = options[:id]
19
19
disk_attachment = client.system_service.vms_service.vm_service(id).disk_attachments_service.attachment_service(disk_id)
20
20
disk_attachment.update(disk_attachment, options)
@@ -23,7 +23,7 @@ module Fog
23
23
end
24
24
25
25
class Mock
26
- extend ::Fog::Compute::Ovirt::V4::Shared
26
+ extend ::Fog::Ovirt::Compute::V4::Shared
27
27
28
28
def update_volume(id, options)
29
29
check_arguments(id, options)
data/lib/fog/ovirt/requests/compute/v4/vm_action.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def vm_action(options = {})
data/lib/fog/ovirt/requests/compute/v4/vm_start_with_cloudinit.rb CHANGED
@@ -1,6 +1,6 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def vm_start_with_cloudinit(options = {})
data/lib/fog/ovirt/requests/compute/v4/vm_ticket.rb CHANGED
@@ -1,10 +1,11 @@
1
1
module Fog
2
- module Compute
3
- class Ovirt
2
+ module Ovirt
3
+ class Compute
4
4
class V4
5
5
class Real
6
6
def vm_ticket(id, options = {})
7
- client.system_service.vms_service.vm_service(id).ticket(options)
7
+ options = convert_string_to_bool(options)
8
+ client.system_service.vms_service.vm_service(id).ticket(options).value
8
9
end
9
10
end
10
11
data/lib/fog/ovirt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
module Fog
2
2
module Ovirt
3
- VERSION = "1.1.3".freeze
3
+ VERSION = "1.2.1".freeze
4
4
end
5
5
end
data/tests/ovirt/compute_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt]", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute.new", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
4
4
tests("Compute attributes") do
5
5
%w[ovirt_attrs].each do |attr|
data/tests/ovirt/models/compute/cluster_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | cluster model", ["ovirt"]) do
2
- clusters = Fog::Compute[:ovirt].clusters
1
+ Shindo.tests("Fog::Ovirt::Compute.new | cluster model", ["ovirt"]) do
2
+ clusters = Fog::Ovirt::Compute.new.clusters
3
3
cluster = clusters.last
4
4
5
5
tests("The cluster model should") do
@@ -23,6 +23,6 @@ Shindo.tests("Fog::Compute[:ovirt] | cluster model", ["ovirt"]) do
23
23
end
24
24
end
25
25
end
26
- test("be a kind of Fog::Compute::Ovirt::Cluster") { cluster.is_a? Fog::Compute::Ovirt::Cluster }
26
+ test("be a kind of Fog::Ovirt::Compute::Cluster") { cluster.is_a? Fog::Ovirt::Compute::Cluster }
27
27
end
28
28
end
data/tests/ovirt/models/compute/clusters_tests.rb CHANGED
@@ -1,7 +1,7 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | clusters collection", ["ovirt"]) do
2
- clusters = Fog::Compute[:ovirt].clusters
1
+ Shindo.tests("Fog::Ovirt::Compute.new | clusters collection", ["ovirt"]) do
2
+ clusters = Fog::Ovirt::Compute.new.clusters
3
3
4
4
tests("The clusters collection") do
5
- test("should be a kind of Fog::Compute::Ovirt::Clusters") { clusters.is_a? Fog::Compute::Ovirt::Clusters }
5
+ test("should be a kind of Fog::Ovirt::Compute::Clusters") { clusters.is_a? Fog::Ovirt::Compute::Clusters }
6
6
end
7
7
end
data/tests/ovirt/models/compute/interface_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | interface model", ["ovirt"]) do
2
- interfaces = Fog::Compute[:ovirt].servers.last.interfaces
1
+ Shindo.tests("Fog::Ovirt::Compute.new | interface model", ["ovirt"]) do
2
+ interfaces = Fog::Ovirt::Compute.new.servers.last.interfaces
3
3
interface = interfaces.last
4
4
5
5
tests("The interface model should") do
@@ -20,6 +20,6 @@ Shindo.tests("Fog::Compute[:ovirt] | interface model", ["ovirt"]) do
20
20
end
21
21
end
22
22
end
23
- test("be a kind of Fog::Compute::Ovirt::Interface") { interface.is_a? Fog::Compute::Ovirt::Interface }
23
+ test("be a kind of Fog::Ovirt::Compute::Interface") { interface.is_a? Fog::Ovirt::Compute::Interface }
24
24
end
25
25
end
data/tests/ovirt/models/compute/interfaces_tests.rb CHANGED
@@ -1,7 +1,7 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | interfaces collection", ["ovirt"]) do
2
- interfaces = Fog::Compute[:ovirt].interfaces
1
+ Shindo.tests("Fog::Ovirt::Compute.new | interfaces collection", ["ovirt"]) do
2
+ interfaces = Fog::Ovirt::Compute.new.interfaces
3
3
4
4
tests("The interfaces collection") do
5
- test("should be a kind of Fog::Compute::Ovirt::Interfaces") { interfaces.is_a? Fog::Compute::Ovirt::Interfaces }
5
+ test("should be a kind of Fog::Ovirt::Compute::Interfaces") { interfaces.is_a? Fog::Ovirt::Compute::Interfaces }
6
6
end
7
7
end
data/tests/ovirt/models/compute/operating_system_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | operating_system model", ["ovirt"]) do
2
- operating_systems = Fog::Compute[:ovirt].operating_systems
1
+ Shindo.tests("Fog::Ovirt::Compute.new | operating_system model", ["ovirt"]) do
2
+ operating_systems = Fog::Ovirt::Compute.new.operating_systems
3
3
operating_system = operating_systems.last
4
4
5
5
tests("The operating_system model should") do
@@ -18,6 +18,6 @@ Shindo.tests("Fog::Compute[:ovirt] | operating_system model", ["ovirt"]) do
18
18
end
19
19
end
20
20
end
21
- test("be a kind of Fog::Compute::Ovirt::OperatingSystem") { operating_system.is_a? Fog::Compute::Ovirt::OperatingSystem }
21
+ test("be a kind of Fog::Ovirt::Compute::OperatingSystem") { operating_system.is_a? Fog::Ovirt::Compute::OperatingSystem }
22
22
end
23
23
end
data/tests/ovirt/models/compute/operating_systems_tests.rb CHANGED
@@ -1,8 +1,8 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | operating_systems collection", ["ovirt"]) do
2
- operating_systems = Fog::Compute[:ovirt].operating_systems
1
+ Shindo.tests("Fog::Ovirt::Compute.new | operating_systems collection", ["ovirt"]) do
2
+ operating_systems = Fog::Ovirt::Compute.new.operating_systems
3
3
4
4
tests("The servers collection") do
5
5
test("should not be empty") { !operating_systems.empty? }
6
- test("should be a kind of Fog::Compute::Ovirt::OperatingSystems") { operating_systems.is_a? Fog::Compute::Ovirt::OperatingSystems }
6
+ test("should be a kind of Fog::Ovirt::Compute::OperatingSystems") { operating_systems.is_a? Fog::Ovirt::Compute::OperatingSystems }
7
7
end
8
8
end
data/tests/ovirt/models/compute/server_tests.rb CHANGED
@@ -1,6 +1,6 @@
1
1
# rubocop:disable Metrics/BlockLength
2
- Shindo.tests("Fog::Compute[:ovirt] | server model", ["ovirt"]) do
3
- servers = Fog::Compute[:ovirt].servers
2
+ Shindo.tests("Fog::Ovirt::Compute.new | server model", ["ovirt"]) do
3
+ servers = Fog::Ovirt::Compute.new.servers
4
4
server = servers.last
5
5
6
6
tests("The server model should") do
@@ -42,7 +42,7 @@ Shindo.tests("Fog::Compute[:ovirt] | server model", ["ovirt"]) do
42
42
end
43
43
end
44
44
end
45
- test("be a kind of Fog::Compute::Ovirt::Server") { server.is_a? Fog::Compute::Ovirt::Server }
45
+ test("be a kind of Fog::Ovirt::Compute::Server") { server.is_a? Fog::Ovirt::Compute::Server }
46
46
end
47
47
end
48
48
# rubocop:enable Metrics/BlockLength
data/tests/ovirt/models/compute/servers_tests.rb CHANGED
@@ -1,9 +1,9 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | servers collection", ["ovirt"]) do
2
- servers = Fog::Compute[:ovirt].servers
1
+ Shindo.tests("Fog::Ovirt::Compute.new | servers collection", ["ovirt"]) do
2
+ servers = Fog::Ovirt::Compute.new.servers
3
3
4
4
tests("The servers collection") do
5
5
test("should not be empty") { !servers.empty? }
6
- test("should be a kind of Fog::Compute::Ovirt::Servers") { servers.is_a? Fog::Compute::Ovirt::Servers }
6
+ test("should be a kind of Fog::Ovirt::Compute::Servers") { servers.is_a? Fog::Ovirt::Compute::Servers }
7
7
tests("should be able to reload itself").succeeds { servers.reload }
8
8
tests("should be able to get a model") do
9
9
tests("by instance uuid").succeeds { servers.get servers.first.id }
data/tests/ovirt/models/compute/template_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | template model", ["ovirt"]) do
2
- templates = Fog::Compute[:ovirt].templates
1
+ Shindo.tests("Fog::Ovirt::Compute.new | template model", ["ovirt"]) do
2
+ templates = Fog::Ovirt::Compute.new.templates
3
3
template = templates.last
4
4
5
5
tests("The template model should") do
@@ -21,6 +21,6 @@ Shindo.tests("Fog::Compute[:ovirt] | template model", ["ovirt"]) do
21
21
end
22
22
end
23
23
end
24
- test("be a kind of Fog::Compute::Ovirt::Template") { template.is_a? Fog::Compute::Ovirt::Template }
24
+ test("be a kind of Fog::Ovirt::Compute::Template") { template.is_a? Fog::Ovirt::Compute::Template }
25
25
end
26
26
end
data/tests/ovirt/models/compute/templates_tests.rb CHANGED
@@ -1,7 +1,7 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | templates collection", ["ovirt"]) do
2
- templates = Fog::Compute[:ovirt].templates
1
+ Shindo.tests("Fog::Ovirt::Compute.new | templates collection", ["ovirt"]) do
2
+ templates = Fog::Ovirt::Compute.new.templates
3
3
4
4
tests("The templates collection") do
5
- test("should be a kind of Fog::Compute::Ovirt::Templates") { templates.is_a? Fog::Compute::Ovirt::Templates }
5
+ test("should be a kind of Fog::Ovirt::Compute::Templates") { templates.is_a? Fog::Ovirt::Compute::Templates }
6
6
end
7
7
end
data/tests/ovirt/requests/compute/v3/client_tests.rb CHANGED
@@ -1,11 +1,11 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | client", ["ovirt"]) do
1
+ 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
5
raise OVIRT::OvirtException, "Test"
6
6
end
7
7
8
- @object_under_test = Fog::Compute::Ovirt::ExceptionWrapper.new(@client_mock)
8
+ @object_under_test = Fog::Ovirt::Compute::ExceptionWrapper.new(@client_mock)
9
9
end
10
10
11
11
tests("Raises the right type of exception")
data/tests/ovirt/requests/compute/v3/create_vm_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | vm_create request", "ovirt") do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute.new | vm_create request", "ovirt") do
2
+ compute = Fog::Ovirt::Compute.new
3
3
name_base = Time.now.to_i
4
4
5
5
tests("Create VM") do
data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | vm_destroy request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | vm_destroy request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default") if compute.servers.all(:search => "fog-*").empty?
4
4
vm_id = compute.servers.all(:search => "fog-*").last.id
5
5
data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | datacenters request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | datacenters request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
4
4
tests("When listing all datacenters") do
5
5
response = compute.datacenters
data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | quotas request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | quotas request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
4
4
tests("When listing all quotas") do
5
5
response = compute.quotas
data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | storage_domains request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | storage_domains request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
4
4
tests("When listing all storage_domains") do
5
5
response = compute.storage_domains
data/tests/ovirt/requests/compute/v3/update_vm_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | vm_update request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | vm_update request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default") if compute.servers.all(:search => "fog-*").empty?
4
4
vm = compute.servers.all(:search => "fog-*").last
5
5
data/tests/ovirt/requests/compute/v3/update_volume_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | update_volume request", ["ovirt"]) do
2
- compute = Fog::Compute[:ovirt]
1
+ Shindo.tests("Fog::Ovirt::Compute | update_volume request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new
3
3
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default") if compute.servers.all(:search => "fog-*").empty?
4
4
vm_id = compute.servers.all(:search => "fog-*").last
5
5
data/tests/ovirt/requests/compute/v4/client_tests.rb CHANGED
@@ -1,11 +1,11 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | client", ["ovirt"]) do
1
+ 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
5
raise OVIRT::OvirtException, "Test"
6
6
end
7
7
8
- @object_under_test = Fog::Compute::Ovirt::ExceptionWrapper.new(@client_mock)
8
+ @object_under_test = Fog::Ovirt::Compute::ExceptionWrapper.new(@client_mock)
9
9
end
10
10
11
11
tests("Raises the right type of exception")
data/tests/ovirt/requests/compute/v4/create_vm_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | vm_create request", "ovirt") do
2
- compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
1
+ Shindo.tests("Fog::Ovirt::Compute v4 | vm_create request", "ovirt") do
2
+ compute = Fog::Ovirt::Compute.new(:api_version => "v4")
3
3
name_base = Time.now.to_i
4
4
5
5
tests("Create VM") do
data/tests/ovirt/requests/compute/v4/destroy_vm_tests.rb CHANGED
@@ -1,5 +1,5 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | vm_destroy request", ["ovirt"]) do
2
- compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
1
+ Shindo.tests("Fog::Ovirt::Compute v4 | vm_destroy request", ["ovirt"]) do
2
+ compute = Fog::Ovirt::Compute.new(:api_version => "v4")
3
3
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default") if compute.servers.all(:search => "fog-*").empty?
4
4
vm_id = compute.servers.all(:search => "fog-*").last.id
5
5
data/tests/ovirt/requests/compute/v4/list_datacenters_tests.rb CHANGED
@@ -1,4 +1,4 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | datacenters request", ["ovirt"]) do
1
+ Shindo.tests("Fog::Ovirt::Compute.new v4 | datacenters request", ["ovirt"]) do
2
2
compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
3
3
4
4
tests("When listing all datacenters") do
data/tests/ovirt/requests/compute/v4/list_quotas_tests.rb CHANGED
@@ -1,4 +1,4 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | quotas request", ["ovirt"]) do
1
+ Shindo.tests("Fog::Ovirt::Compute.new v4 | quotas request", ["ovirt"]) do
2
2
compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
3
3
4
4
tests("When listing all quotas") do
data/tests/ovirt/requests/compute/v4/list_storage_domains_tests.rb CHANGED
@@ -1,4 +1,4 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | storage_domains request", ["ovirt"]) do
1
+ Shindo.tests("Fog::Ovirt::Compute.new v4 | storage_domains request", ["ovirt"]) do
2
2
compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
3
3
4
4
tests("When listing all storage_domains") do
data/tests/ovirt/requests/compute/v4/update_volume_tests.rb CHANGED
@@ -1,4 +1,4 @@
1
- Shindo.tests("Fog::Compute[:ovirt] v4 | update_volume request", ["ovirt"]) do
1
+ Shindo.tests("Fog::Ovirt::Compute.new v4 | update_volume request", ["ovirt"]) do
2
2
compute = Fog::Compute.new(:provider => :ovirt, :api_version => "v4")
3
3
compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default") if compute.servers.all(:search => "fog-*").empty?
4
4
vm_id = compute.servers.all(:search => "fog-*").last
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.1.3
4
+ version: 1.2.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: 2018-12-03 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
14
name: fog-core
@@ -353,8 +353,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
353
- !ruby/object:Gem::Version
354
354
version: '0'
355
355
requirements: []
356
- rubyforge_project:
356
+ rubygems_version: 3.0.3
357
- rubygems_version: 2.6.14
358
357
signing_key:
359
358
specification_version: 4
360
359
summary: Module for the 'fog' gem to support Ovirt.