fog-ovirt 0.1.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +20 -0
  3. data/.rubocop_todo.yml +43 -0
  4. data/.travis.yml +3 -1
  5. data/Gemfile +1 -1
  6. data/Rakefile +15 -5
  7. data/fog-ovirt.gemspec +15 -14
  8. data/lib/fog/bin/ovirt.rb +1 -1
  9. data/lib/fog/ovirt.rb +1 -1
  10. data/lib/fog/ovirt/compute.rb +56 -112
  11. data/lib/fog/ovirt/compute/v3.rb +137 -0
  12. data/lib/fog/ovirt/core.rb +13 -4
  13. data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
  14. data/lib/fog/ovirt/models/compute/affinity_groups.rb +2 -2
  15. data/lib/fog/ovirt/models/compute/clusters.rb +2 -2
  16. data/lib/fog/ovirt/models/compute/instance_types.rb +2 -2
  17. data/lib/fog/ovirt/models/compute/interfaces.rb +7 -5
  18. data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
  19. data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
  20. data/lib/fog/ovirt/models/compute/server.rb +37 -31
  21. data/lib/fog/ovirt/models/compute/servers.rb +2 -2
  22. data/lib/fog/ovirt/models/compute/template.rb +9 -9
  23. data/lib/fog/ovirt/models/compute/templates.rb +2 -2
  24. data/lib/fog/ovirt/models/compute/volume.rb +3 -3
  25. data/lib/fog/ovirt/models/compute/volumes.rb +6 -4
  26. data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +23 -0
  27. data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +22 -0
  28. data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +23 -0
  29. data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +23 -0
  30. data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +24 -0
  31. data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +20 -0
  32. data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +20 -0
  33. data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +22 -0
  34. data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +24 -0
  35. data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +21 -0
  36. data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +24 -0
  37. data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +21 -0
  38. data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +24 -0
  39. data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +24 -0
  40. data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +20 -0
  41. data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +18 -0
  42. data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +19 -0
  43. data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +19 -0
  44. data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +19 -0
  45. data/lib/fog/ovirt/requests/compute/v3/get_template.rb +19 -0
  46. data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +19 -0
  47. data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +24 -0
  48. data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +22 -0
  49. data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +21 -0
  50. data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +21 -0
  51. data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +18 -0
  52. data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +21 -0
  53. data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +21 -0
  54. data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +21 -0
  55. data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +21 -0
  56. data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +21 -0
  57. data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +21 -0
  58. data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +21 -0
  59. data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +21 -0
  60. data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +21 -0
  61. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup.xml +0 -0
  62. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroup_vms.xml +0 -0
  63. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/affinitygroups.xml +0 -0
  64. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/cluster.xml +0 -0
  65. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/clusters.xml +0 -0
  66. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/data_centers.xml +0 -0
  67. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/disks.xml +0 -0
  68. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_type.xml +0 -0
  69. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/instance_types.xml +0 -0
  70. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/nics.xml +0 -0
  71. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/operating_systems.xml +0 -0
  72. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/quotas.xml +0 -0
  73. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/storage_domains.xml +0 -0
  74. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/template.xml +0 -0
  75. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/templates.xml +0 -0
  76. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vm.xml +0 -0
  77. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/vms.xml +0 -0
  78. data/lib/fog/ovirt/requests/compute/{mock_files → v3/mock_files}/volumes.xml +0 -0
  79. data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +23 -0
  80. data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +22 -0
  81. data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +36 -0
  82. data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +20 -0
  83. data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +37 -0
  84. data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +24 -0
  85. data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +21 -0
  86. data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +19 -0
  87. data/lib/fog/ovirt/version.rb +1 -1
  88. data/tests/helper.rb +1 -1
  89. data/tests/helpers/mock_helper.rb +4 -6
  90. data/tests/helpers/succeeds_helper.rb +1 -1
  91. data/tests/ovirt/compute_tests.rb +5 -6
  92. data/tests/ovirt/models/compute/cluster_tests.rb +10 -13
  93. data/tests/ovirt/models/compute/clusters_tests.rb +3 -5
  94. data/tests/ovirt/models/compute/interface_tests.rb +9 -11
  95. data/tests/ovirt/models/compute/interfaces_tests.rb +3 -5
  96. data/tests/ovirt/models/compute/operating_system_tests.rb +7 -13
  97. data/tests/ovirt/models/compute/operating_systems_tests.rb +4 -6
  98. data/tests/ovirt/models/compute/server_tests.rb +29 -32
  99. data/tests/ovirt/models/compute/servers_tests.rb +7 -9
  100. data/tests/ovirt/models/compute/template_tests.rb +10 -12
  101. data/tests/ovirt/models/compute/templates_tests.rb +3 -5
  102. data/tests/ovirt/requests/compute/client_tests.rb +31 -0
  103. data/tests/ovirt/requests/compute/create_vm_tests.rb +7 -16
  104. data/tests/ovirt/requests/compute/destroy_vm_tests.rb +8 -10
  105. data/tests/ovirt/requests/compute/list_datacenters_tests.rb +3 -5
  106. data/tests/ovirt/requests/compute/list_quotas_tests.rb +2 -4
  107. data/tests/ovirt/requests/compute/list_storage_domains_tests.rb +3 -5
  108. data/tests/ovirt/requests/compute/update_vm_tests.rb +9 -11
  109. data/tests/ovirt/requests/compute/update_volume_tests.rb +9 -12
  110. metadata +70 -65
  111. data/lib/fog/ovirt/requests/compute/activate_volume.rb +0 -22
  112. data/lib/fog/ovirt/requests/compute/add_interface.rb +0 -20
  113. data/lib/fog/ovirt/requests/compute/add_to_affinity_group.rb +0 -21
  114. data/lib/fog/ovirt/requests/compute/add_volume.rb +0 -21
  115. data/lib/fog/ovirt/requests/compute/attach_volume.rb +0 -22
  116. data/lib/fog/ovirt/requests/compute/create_affinity_group.rb +0 -18
  117. data/lib/fog/ovirt/requests/compute/create_vm.rb +0 -18
  118. data/lib/fog/ovirt/requests/compute/datacenters.rb +0 -20
  119. data/lib/fog/ovirt/requests/compute/deactivate_volume.rb +0 -22
  120. data/lib/fog/ovirt/requests/compute/destroy_affinity_group.rb +0 -19
  121. data/lib/fog/ovirt/requests/compute/destroy_interface.rb +0 -22
  122. data/lib/fog/ovirt/requests/compute/destroy_vm.rb +0 -19
  123. data/lib/fog/ovirt/requests/compute/destroy_volume.rb +0 -22
  124. data/lib/fog/ovirt/requests/compute/detach_volume.rb +0 -22
  125. data/lib/fog/ovirt/requests/compute/get_affinity_group.rb +0 -18
  126. data/lib/fog/ovirt/requests/compute/get_api_version.rb +0 -16
  127. data/lib/fog/ovirt/requests/compute/get_cluster.rb +0 -17
  128. data/lib/fog/ovirt/requests/compute/get_instance_type.rb +0 -17
  129. data/lib/fog/ovirt/requests/compute/get_quota.rb +0 -17
  130. data/lib/fog/ovirt/requests/compute/get_template.rb +0 -17
  131. data/lib/fog/ovirt/requests/compute/get_virtual_machine.rb +0 -17
  132. data/lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb +0 -22
  133. data/lib/fog/ovirt/requests/compute/list_affinity_groups.rb +0 -20
  134. data/lib/fog/ovirt/requests/compute/list_clusters.rb +0 -19
  135. data/lib/fog/ovirt/requests/compute/list_instance_types.rb +0 -19
  136. data/lib/fog/ovirt/requests/compute/list_networks.rb +0 -16
  137. data/lib/fog/ovirt/requests/compute/list_operating_systems.rb +0 -19
  138. data/lib/fog/ovirt/requests/compute/list_quotas.rb +0 -19
  139. data/lib/fog/ovirt/requests/compute/list_template_interfaces.rb +0 -19
  140. data/lib/fog/ovirt/requests/compute/list_template_volumes.rb +0 -19
  141. data/lib/fog/ovirt/requests/compute/list_templates.rb +0 -19
  142. data/lib/fog/ovirt/requests/compute/list_virtual_machines.rb +0 -19
  143. data/lib/fog/ovirt/requests/compute/list_vm_interfaces.rb +0 -19
  144. data/lib/fog/ovirt/requests/compute/list_vm_volumes.rb +0 -19
  145. data/lib/fog/ovirt/requests/compute/list_volumes.rb +0 -19
  146. data/lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb +0 -21
  147. data/lib/fog/ovirt/requests/compute/storage_domains.rb +0 -20
  148. data/lib/fog/ovirt/requests/compute/update_interface.rb +0 -35
  149. data/lib/fog/ovirt/requests/compute/update_vm.rb +0 -18
  150. data/lib/fog/ovirt/requests/compute/update_volume.rb +0 -39
  151. data/lib/fog/ovirt/requests/compute/vm_action.rb +0 -22
  152. data/lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb +0 -19
  153. data/lib/fog/ovirt/requests/compute/vm_ticket.rb +0 -17
@@ -1,14 +1,12 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | servers collection', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | servers collection", ["ovirt"]) do
3
2
  servers = Fog::Compute[:ovirt].servers
4
3
 
5
- tests('The servers collection') do
6
- test('should not be empty') { not servers.empty? }
7
- test('should be a kind of Fog::Compute::Ovirt::Servers') { servers.kind_of? Fog::Compute::Ovirt::Servers }
8
- tests('should be able to reload itself').succeeds { servers.reload }
9
- tests('should be able to get a model') do
10
- tests('by instance uuid').succeeds { servers.get servers.first.id }
4
+ tests("The servers collection") do
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 }
7
+ tests("should be able to reload itself").succeeds { servers.reload }
8
+ tests("should be able to get a model") do
9
+ tests("by instance uuid").succeeds { servers.get servers.first.id }
11
10
  end
12
11
  end
13
-
14
12
  end
@@ -1,28 +1,26 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | template model', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | template model", ["ovirt"]) do
3
2
  templates = Fog::Compute[:ovirt].templates
4
3
  template = templates.last
5
4
 
6
- tests('The template model should') do
7
- tests('have the action') do
8
- test('reload') { template.respond_to? 'reload' }
5
+ tests("The template model should") do
6
+ tests("have the action") do
7
+ test("reload") { template.respond_to? "reload" }
9
8
  end
10
- tests('have attributes') do
9
+ tests("have attributes") do
11
10
  model_attribute_hash = template.attributes
12
- attributes = [ :id,
13
- :name]
11
+ attributes = %i[id name]
12
+
14
13
  tests("The template model should respond to") do
15
14
  attributes.each do |attribute|
16
- test("#{attribute}") { template.respond_to? attribute }
15
+ test(attribute.to_s) { template.respond_to? attribute }
17
16
  end
18
17
  end
19
18
  tests("The attributes hash should have key") do
20
19
  attributes.each do |attribute|
21
- test("#{attribute}") { model_attribute_hash.key? attribute }
20
+ test(attribute.to_s) { model_attribute_hash.key? attribute }
22
21
  end
23
22
  end
24
23
  end
25
- test('be a kind of Fog::Compute::Ovirt::Template') { template.kind_of? Fog::Compute::Ovirt::Template }
24
+ test("be a kind of Fog::Compute::Ovirt::Template") { template.is_a? Fog::Compute::Ovirt::Template }
26
25
  end
27
-
28
26
  end
@@ -1,9 +1,7 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | templates collection', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | templates collection", ["ovirt"]) do
3
2
  templates = Fog::Compute[:ovirt].templates
4
3
 
5
- tests('The templates collection') do
6
- test('should be a kind of Fog::Compute::Ovirt::Templates') { templates.kind_of? Fog::Compute::Ovirt::Templates }
4
+ tests("The templates collection") do
5
+ test("should be a kind of Fog::Compute::Ovirt::Templates") { templates.is_a? Fog::Compute::Ovirt::Templates }
7
6
  end
8
-
9
7
  end
@@ -0,0 +1,31 @@
1
+ Shindo.tests("Fog::Compute[:ovirt] | client", ["ovirt"]) do
2
+ before do
3
+ @client_mock = Object.new
4
+ def @client_mock.foo
5
+ raise OVIRT::OvirtException, "Test"
6
+ end
7
+
8
+ @object_under_test = Fog::Compute::Ovirt::ExceptionWrapper.new(@client_mock)
9
+ end
10
+
11
+ tests("Raises the right type of exception")
12
+ .raises(Fog::Ovirt::Errors::OvirtEngineError) do
13
+ @object_under_test.foo
14
+ end
15
+
16
+ tests("The exception test is as expected").returns(true) do
17
+ begin
18
+ @object_under_test.foo
19
+ rescue Fog::Ovirt::Errors::OvirtEngineError => e
20
+ e.message == "Ovirt client returned an error: Test"
21
+ end
22
+ end
23
+
24
+ tests("The original exception test is as expected").returns(true) do
25
+ begin
26
+ @object_under_test.foo
27
+ rescue Fog::Ovirt::Errors::OvirtEngineError => e
28
+ e.orig_exception.message == "Test"
29
+ end
30
+ end
31
+ end
@@ -1,26 +1,17 @@
1
- Shindo.tests("Fog::Compute[:ovirt] | vm_create request", 'ovirt') do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | vm_create request", "ovirt") do
3
2
  compute = Fog::Compute[:ovirt]
4
3
  name_base = Time.now.to_i
5
4
 
6
5
  tests("Create VM") do
7
- response = compute.create_vm(:name => 'fog-'+name_base.to_s, :cluster_name => 'Default')
8
- test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
6
+ response = compute.create_vm(:name => "fog-" + name_base.to_s, :cluster_name => "Default")
7
+ test("should be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
9
8
  end
10
9
 
11
10
  tests("Create VM from template (clone)") do
12
- response = compute.create_vm(:name => 'fog-'+(name_base+ 1).to_s, :template_name => 'hwp_small', :cluster_name => 'Default')
13
- test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
14
- end
15
-
16
- tests("Fail Creating VM") do
17
- begin
18
- response = compute.create_vm(:name => 'fog-'+name_base.to_s, :cluster_name => 'Default')
19
- test("should be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM} #mock never raise exceptions
20
- rescue => e
21
- #should raise vm name already exist exception.
22
- test("error should be a kind of OVIRT::OvirtException") { e.kind_of? OVIRT::OvirtException}
23
- end
11
+ response = compute.create_vm(:name => "fog-" + (name_base + 1).to_s, :template_name => "hwp_small", :cluster_name => "Default")
12
+ test("should be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
24
13
  end
25
14
 
15
+ # TODO: Write a test for situation where creating a VM fails
16
+ # mocks never raise exceptions
26
17
  end
@@ -1,18 +1,16 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | vm_destroy request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | vm_destroy request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
- if compute.servers.all(:search => 'fog-*').empty?
5
- compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
3
+ if compute.servers.all(:search => "fog-*").empty?
4
+ compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
6
5
  end
7
- vm_id = compute.servers.all(:search => 'fog-*').last.id
6
+ vm_id = compute.servers.all(:search => "fog-*").last.id
8
7
 
9
- tests('The response should') do
8
+ tests("The response should") do
10
9
  response = compute.destroy_vm(:id => vm_id)
11
- test('be a success') { response ? true: false }
10
+ test("be a success") { response ? true : false }
12
11
  end
13
12
 
14
- tests('The expected options') do
15
- raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.destroy_vm }
13
+ tests("The expected options") do
14
+ raises(ArgumentError, "raises ArgumentError when id option is missing") { compute.destroy_vm }
16
15
  end
17
-
18
16
  end
@@ -1,13 +1,11 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | datacenters request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | datacenters request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
3
 
5
4
  tests("When listing all datacenters") do
6
-
7
5
  response = compute.datacenters
8
6
  tests("The response data format ...") do
9
- test("it should be a kind of Array") { response.kind_of? Array }
10
- test("be a kind of Hash") { response.first.kind_of? Hash }
7
+ test("it should be a kind of Array") { response.is_a? Array }
8
+ test("be a kind of Hash") { response.first.is_a? Hash }
11
9
  end
12
10
  end
13
11
  end
@@ -1,12 +1,10 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | quotas request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | quotas request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
3
 
5
4
  tests("When listing all quotas") do
6
-
7
5
  response = compute.quotas
8
6
  tests("The response data format ...") do
9
- test("it should be a kind of Array") { response.kind_of? Array }
7
+ test("it should be a kind of Array") { response.is_a? Array }
10
8
  end
11
9
  end
12
10
  end
@@ -1,13 +1,11 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | storage_domains request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | storage_domains request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
3
 
5
4
  tests("When listing all storage_domains") do
6
-
7
5
  response = compute.storage_domains
8
6
  tests("The response data format ...") do
9
- test("it should be a kind of Array") { response.kind_of? Array }
10
- test("be a kind of OVIRT::StorageDomain") { response.first.kind_of? OVIRT::StorageDomain }
7
+ test("it should be a kind of Array") { response.is_a? Array }
8
+ test("be a kind of OVIRT::StorageDomain") { response.first.is_a? OVIRT::StorageDomain }
11
9
  end
12
10
  end
13
11
  end
@@ -1,18 +1,16 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | vm_update request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | vm_update request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
- if compute.servers.all(:search => 'fog-*').empty?
5
- compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
3
+ if compute.servers.all(:search => "fog-*").empty?
4
+ compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
6
5
  end
7
- vm = compute.servers.all(:search => 'fog-*').last
6
+ vm = compute.servers.all(:search => "fog-*").last
8
7
 
9
- tests('The response should') do
10
- response = compute.update_vm(:id => vm.id, :name => vm.name + 'updated')
11
- test("be a kind of OVIRT::VM") { response.kind_of? OVIRT::VM}
8
+ tests("The response should") do
9
+ response = compute.update_vm(:id => vm.id, :name => vm.name + "updated")
10
+ test("be a kind of OVIRT::VM") { response.is_a? OVIRT::VM }
12
11
  end
13
12
 
14
- tests('The expected options') do
15
- raises(ArgumentError, 'raises ArgumentError when id option is missing') { compute.update_vm }
13
+ tests("The expected options") do
14
+ raises(ArgumentError, "raises ArgumentError when id option is missing") { compute.update_vm }
16
15
  end
17
-
18
16
  end
@@ -1,20 +1,17 @@
1
- Shindo.tests('Fog::Compute[:ovirt] | update_volume request', ['ovirt']) do
2
-
1
+ Shindo.tests("Fog::Compute[:ovirt] | update_volume request", ["ovirt"]) do
3
2
  compute = Fog::Compute[:ovirt]
4
- if compute.servers.all(:search => 'fog-*').empty?
5
- compute.create_vm(:name => 'fog-'+Time.now.to_i.to_s, :cluster_name => 'Default')
3
+ if compute.servers.all(:search => "fog-*").empty?
4
+ compute.create_vm(:name => "fog-" + Time.now.to_i.to_s, :cluster_name => "Default")
6
5
  end
7
- vm_id = compute.servers.all(:search => 'fog-*').last
6
+ vm_id = compute.servers.all(:search => "fog-*").last
8
7
 
9
- tests('The expected options') do
10
- raises(ArgumentError, 'raises ArgumentError when vm id is missing') { compute.update_volume(nil, {:id => 1}) }
11
- raises(ArgumentError, 'raises ArgumentError when disk_id option is missing') { compute.update_volume(1, {:any => 1}) }
8
+ tests("The expected options") do
9
+ raises(ArgumentError, "raises ArgumentError when vm id is missing") { compute.update_volume(nil, :id => 1) }
10
+ raises(ArgumentError, "raises ArgumentError when disk_id option is missing") { compute.update_volume(1, :any => 1) }
12
11
  end
13
12
 
14
- tests('The response should') do
13
+ tests("The response should") do
15
14
  response = compute.update_volume(vm_id, :id => 1)
16
- test('be a success') { response ? true: false }
15
+ test("be a success") { response ? true : false }
17
16
  end
18
-
19
-
20
17
  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: 0.1.3
4
+ version: 1.0.0
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-02-19 00:00:00.000000000 Z
11
+ date: 2018-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0.34'
117
+ version: '0.52'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0.34'
124
+ version: '0.52'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: shindo
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -144,6 +144,8 @@ extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
146
  - ".gitignore"
147
+ - ".rubocop.yml"
148
+ - ".rubocop_todo.yml"
147
149
  - ".travis.yml"
148
150
  - CONTRIBUTING.md
149
151
  - CONTRIBUTORS.md
@@ -155,6 +157,7 @@ files:
155
157
  - lib/fog/bin/ovirt.rb
156
158
  - lib/fog/ovirt.rb
157
159
  - lib/fog/ovirt/compute.rb
160
+ - lib/fog/ovirt/compute/v3.rb
158
161
  - lib/fog/ovirt/core.rb
159
162
  - lib/fog/ovirt/models/compute/affinity_group.rb
160
163
  - lib/fog/ovirt/models/compute/affinity_groups.rb
@@ -174,67 +177,67 @@ files:
174
177
  - lib/fog/ovirt/models/compute/templates.rb
175
178
  - lib/fog/ovirt/models/compute/volume.rb
176
179
  - lib/fog/ovirt/models/compute/volumes.rb
177
- - lib/fog/ovirt/requests/compute/activate_volume.rb
178
- - lib/fog/ovirt/requests/compute/add_interface.rb
179
- - lib/fog/ovirt/requests/compute/add_to_affinity_group.rb
180
- - lib/fog/ovirt/requests/compute/add_volume.rb
181
- - lib/fog/ovirt/requests/compute/attach_volume.rb
182
- - lib/fog/ovirt/requests/compute/create_affinity_group.rb
183
- - lib/fog/ovirt/requests/compute/create_vm.rb
184
- - lib/fog/ovirt/requests/compute/datacenters.rb
185
- - lib/fog/ovirt/requests/compute/deactivate_volume.rb
186
- - lib/fog/ovirt/requests/compute/destroy_affinity_group.rb
187
- - lib/fog/ovirt/requests/compute/destroy_interface.rb
188
- - lib/fog/ovirt/requests/compute/destroy_vm.rb
189
- - lib/fog/ovirt/requests/compute/destroy_volume.rb
190
- - lib/fog/ovirt/requests/compute/detach_volume.rb
191
- - lib/fog/ovirt/requests/compute/get_affinity_group.rb
192
- - lib/fog/ovirt/requests/compute/get_api_version.rb
193
- - lib/fog/ovirt/requests/compute/get_cluster.rb
194
- - lib/fog/ovirt/requests/compute/get_instance_type.rb
195
- - lib/fog/ovirt/requests/compute/get_quota.rb
196
- - lib/fog/ovirt/requests/compute/get_template.rb
197
- - lib/fog/ovirt/requests/compute/get_virtual_machine.rb
198
- - lib/fog/ovirt/requests/compute/list_affinity_group_vms.rb
199
- - lib/fog/ovirt/requests/compute/list_affinity_groups.rb
200
- - lib/fog/ovirt/requests/compute/list_clusters.rb
201
- - lib/fog/ovirt/requests/compute/list_instance_types.rb
202
- - lib/fog/ovirt/requests/compute/list_networks.rb
203
- - lib/fog/ovirt/requests/compute/list_operating_systems.rb
204
- - lib/fog/ovirt/requests/compute/list_quotas.rb
205
- - lib/fog/ovirt/requests/compute/list_template_interfaces.rb
206
- - lib/fog/ovirt/requests/compute/list_template_volumes.rb
207
- - lib/fog/ovirt/requests/compute/list_templates.rb
208
- - lib/fog/ovirt/requests/compute/list_virtual_machines.rb
209
- - lib/fog/ovirt/requests/compute/list_vm_interfaces.rb
210
- - lib/fog/ovirt/requests/compute/list_vm_volumes.rb
211
- - lib/fog/ovirt/requests/compute/list_volumes.rb
212
- - lib/fog/ovirt/requests/compute/mock_files/affinitygroup.xml
213
- - lib/fog/ovirt/requests/compute/mock_files/affinitygroup_vms.xml
214
- - lib/fog/ovirt/requests/compute/mock_files/affinitygroups.xml
215
- - lib/fog/ovirt/requests/compute/mock_files/cluster.xml
216
- - lib/fog/ovirt/requests/compute/mock_files/clusters.xml
217
- - lib/fog/ovirt/requests/compute/mock_files/data_centers.xml
218
- - lib/fog/ovirt/requests/compute/mock_files/disks.xml
219
- - lib/fog/ovirt/requests/compute/mock_files/instance_type.xml
220
- - lib/fog/ovirt/requests/compute/mock_files/instance_types.xml
221
- - lib/fog/ovirt/requests/compute/mock_files/nics.xml
222
- - lib/fog/ovirt/requests/compute/mock_files/operating_systems.xml
223
- - lib/fog/ovirt/requests/compute/mock_files/quotas.xml
224
- - lib/fog/ovirt/requests/compute/mock_files/storage_domains.xml
225
- - lib/fog/ovirt/requests/compute/mock_files/template.xml
226
- - lib/fog/ovirt/requests/compute/mock_files/templates.xml
227
- - lib/fog/ovirt/requests/compute/mock_files/vm.xml
228
- - lib/fog/ovirt/requests/compute/mock_files/vms.xml
229
- - lib/fog/ovirt/requests/compute/mock_files/volumes.xml
230
- - lib/fog/ovirt/requests/compute/remove_from_affinity_group.rb
231
- - lib/fog/ovirt/requests/compute/storage_domains.rb
232
- - lib/fog/ovirt/requests/compute/update_interface.rb
233
- - lib/fog/ovirt/requests/compute/update_vm.rb
234
- - lib/fog/ovirt/requests/compute/update_volume.rb
235
- - lib/fog/ovirt/requests/compute/vm_action.rb
236
- - lib/fog/ovirt/requests/compute/vm_start_with_cloudinit.rb
237
- - lib/fog/ovirt/requests/compute/vm_ticket.rb
180
+ - lib/fog/ovirt/requests/compute/v3/activate_volume.rb
181
+ - lib/fog/ovirt/requests/compute/v3/add_interface.rb
182
+ - lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb
183
+ - lib/fog/ovirt/requests/compute/v3/add_volume.rb
184
+ - lib/fog/ovirt/requests/compute/v3/attach_volume.rb
185
+ - lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb
186
+ - lib/fog/ovirt/requests/compute/v3/create_vm.rb
187
+ - lib/fog/ovirt/requests/compute/v3/datacenters.rb
188
+ - lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb
189
+ - lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb
190
+ - lib/fog/ovirt/requests/compute/v3/destroy_interface.rb
191
+ - lib/fog/ovirt/requests/compute/v3/destroy_vm.rb
192
+ - lib/fog/ovirt/requests/compute/v3/destroy_volume.rb
193
+ - lib/fog/ovirt/requests/compute/v3/detach_volume.rb
194
+ - lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb
195
+ - lib/fog/ovirt/requests/compute/v3/get_api_version.rb
196
+ - lib/fog/ovirt/requests/compute/v3/get_cluster.rb
197
+ - lib/fog/ovirt/requests/compute/v3/get_instance_type.rb
198
+ - lib/fog/ovirt/requests/compute/v3/get_quota.rb
199
+ - lib/fog/ovirt/requests/compute/v3/get_template.rb
200
+ - lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb
201
+ - lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb
202
+ - lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb
203
+ - lib/fog/ovirt/requests/compute/v3/list_clusters.rb
204
+ - lib/fog/ovirt/requests/compute/v3/list_instance_types.rb
205
+ - lib/fog/ovirt/requests/compute/v3/list_networks.rb
206
+ - lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb
207
+ - lib/fog/ovirt/requests/compute/v3/list_quotas.rb
208
+ - lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb
209
+ - lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb
210
+ - lib/fog/ovirt/requests/compute/v3/list_templates.rb
211
+ - lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb
212
+ - lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb
213
+ - lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb
214
+ - lib/fog/ovirt/requests/compute/v3/list_volumes.rb
215
+ - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml
216
+ - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml
217
+ - lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml
218
+ - lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml
219
+ - lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml
220
+ - lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml
221
+ - lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml
222
+ - lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml
223
+ - lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml
224
+ - lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml
225
+ - lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml
226
+ - lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml
227
+ - lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml
228
+ - lib/fog/ovirt/requests/compute/v3/mock_files/template.xml
229
+ - lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml
230
+ - lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml
231
+ - lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml
232
+ - lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml
233
+ - lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb
234
+ - lib/fog/ovirt/requests/compute/v3/storage_domains.rb
235
+ - lib/fog/ovirt/requests/compute/v3/update_interface.rb
236
+ - lib/fog/ovirt/requests/compute/v3/update_vm.rb
237
+ - lib/fog/ovirt/requests/compute/v3/update_volume.rb
238
+ - lib/fog/ovirt/requests/compute/v3/vm_action.rb
239
+ - lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb
240
+ - lib/fog/ovirt/requests/compute/v3/vm_ticket.rb
238
241
  - lib/fog/ovirt/version.rb
239
242
  - spec/fog/bin/ovirt_spec.rb
240
243
  - spec/fog/bin_spec.rb
@@ -252,6 +255,7 @@ files:
252
255
  - tests/ovirt/models/compute/servers_tests.rb
253
256
  - tests/ovirt/models/compute/template_tests.rb
254
257
  - tests/ovirt/models/compute/templates_tests.rb
258
+ - tests/ovirt/requests/compute/client_tests.rb
255
259
  - tests/ovirt/requests/compute/create_vm_tests.rb
256
260
  - tests/ovirt/requests/compute/destroy_vm_tests.rb
257
261
  - tests/ovirt/requests/compute/list_datacenters_tests.rb
@@ -298,6 +302,7 @@ test_files:
298
302
  - tests/ovirt/models/compute/servers_tests.rb
299
303
  - tests/ovirt/models/compute/template_tests.rb
300
304
  - tests/ovirt/models/compute/templates_tests.rb
305
+ - tests/ovirt/requests/compute/client_tests.rb
301
306
  - tests/ovirt/requests/compute/create_vm_tests.rb
302
307
  - tests/ovirt/requests/compute/destroy_vm_tests.rb
303
308
  - tests/ovirt/requests/compute/list_datacenters_tests.rb