fog-ovirt 1.1.6 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +12 -5
- data/lib/fog/bin/ovirt.rb +3 -3
- data/lib/fog/ovirt.rb +2 -4
- data/lib/fog/ovirt/compute.rb +12 -12
- data/lib/fog/ovirt/compute/v3.rb +2 -2
- data/lib/fog/ovirt/compute/v4.rb +4 -2
- data/lib/fog/ovirt/models/compute/affinity_group.rb +2 -2
- data/lib/fog/ovirt/models/compute/affinity_groups.rb +3 -3
- data/lib/fog/ovirt/models/compute/cluster.rb +2 -2
- data/lib/fog/ovirt/models/compute/clusters.rb +3 -3
- data/lib/fog/ovirt/models/compute/instance_type.rb +2 -2
- data/lib/fog/ovirt/models/compute/instance_types.rb +3 -3
- data/lib/fog/ovirt/models/compute/interface.rb +2 -2
- data/lib/fog/ovirt/models/compute/interfaces.rb +5 -5
- data/lib/fog/ovirt/models/compute/operating_system.rb +2 -2
- data/lib/fog/ovirt/models/compute/operating_systems.rb +3 -3
- data/lib/fog/ovirt/models/compute/quota.rb +2 -2
- data/lib/fog/ovirt/models/compute/quotas.rb +3 -3
- data/lib/fog/ovirt/models/compute/server.rb +4 -4
- data/lib/fog/ovirt/models/compute/servers.rb +3 -3
- data/lib/fog/ovirt/models/compute/template.rb +4 -4
- data/lib/fog/ovirt/models/compute/templates.rb +3 -3
- data/lib/fog/ovirt/models/compute/volume.rb +4 -4
- data/lib/fog/ovirt/models/compute/volumes.rb +5 -5
- data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_template.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +3 -3
- data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +4 -4
- data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +4 -4
- data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/add_interface.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +6 -7
- data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +3 -3
- data/lib/fog/ovirt/requests/compute/v4/datacenters.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/destroy_interface.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/destroy_vm.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/destroy_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_api_version.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_cluster.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_instance_type.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_quota.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_template.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/get_virtual_machine.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_clusters.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_instance_types.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_networks.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_operating_systems.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_quotas.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_template_interfaces.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_templates.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_virtual_machines.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_vm_interfaces.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/list_volumes.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/update_interface.rb +4 -4
- data/lib/fog/ovirt/requests/compute/v4/update_vm.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/update_volume.rb +4 -4
- data/lib/fog/ovirt/requests/compute/v4/vm_action.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/vm_start_with_cloudinit.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/vm_ticket.rb +2 -2
- data/lib/fog/ovirt/version.rb +1 -1
- data/tests/ovirt/compute_tests.rb +2 -2
- data/tests/ovirt/models/compute/cluster_tests.rb +3 -3
- data/tests/ovirt/models/compute/clusters_tests.rb +3 -3
- data/tests/ovirt/models/compute/interface_tests.rb +3 -3
- data/tests/ovirt/models/compute/interfaces_tests.rb +3 -3
- data/tests/ovirt/models/compute/operating_system_tests.rb +3 -3
- data/tests/ovirt/models/compute/operating_systems_tests.rb +3 -3
- data/tests/ovirt/models/compute/server_tests.rb +3 -3
- data/tests/ovirt/models/compute/servers_tests.rb +3 -3
- data/tests/ovirt/models/compute/template_tests.rb +3 -3
- data/tests/ovirt/models/compute/templates_tests.rb +3 -3
- data/tests/ovirt/requests/compute/v3/client_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v3/update_volume_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v4/client_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v4/create_vm_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v4/destroy_vm_tests.rb +2 -2
- data/tests/ovirt/requests/compute/v4/list_datacenters_tests.rb +1 -1
- data/tests/ovirt/requests/compute/v4/list_quotas_tests.rb +1 -1
- data/tests/ovirt/requests/compute/v4/list_storage_domains_tests.rb +1 -1
- data/tests/ovirt/requests/compute/v4/update_volume_tests.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6c8f50700ff436d3f31a8c67a536c630cd6b8166dffd761f0ec3eaa751bad22
|
4
|
+
data.tar.gz: d3ab17d6c140811ec0843778869c416ea0323cf222efbd5c648128b63ccbe52e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6a869a3392da2cb17182a5b1d4dbbcaf286757bf55dbf7b0a00bec3ee79351c4d0cd137e1ad1c03001202b1a7e0ae56854b27f65ba78ee81b0e9555291d2998
|
7
|
+
data.tar.gz: df66a186ce9979c987bbc62097b20dd0d1022d5f547549c42806b32441c7a5c3ca58d59e014a24b9e9b6094a3c882356d116cccd31a615504da130788aefdeb5
|
data/.rubocop_todo.yml
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on
|
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:
|
15
|
-
# Configuration parameters: CountComments.
|
14
|
+
# Offense count: 10
|
15
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
16
16
|
Metrics/MethodLength:
|
17
|
-
Max:
|
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:
|
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
|
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
|
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
|
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
data/lib/fog/ovirt/compute.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
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::
|
61
|
+
@client = Fog::Ovirt::Compute::V4.new(options)
|
62
62
|
else
|
63
|
-
@client = Fog::Compute::
|
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::
|
82
|
-
@client = Fog::Compute::
|
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::
|
85
|
-
@client = Fog::Compute::
|
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::
|
104
|
-
@client = Fog::Compute::
|
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::
|
107
|
-
@client = Fog::Compute::
|
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
data/lib/fog/ovirt/compute/v4.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
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,
|
@@ -95,6 +95,7 @@ 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
|
}
|
@@ -111,6 +112,7 @@ module Fog
|
|
111
112
|
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
112
113
|
|
113
114
|
def convert_string_to_bool(opts)
|
115
|
+
return opts unless opts.present?
|
114
116
|
opts.each do |key, value|
|
115
117
|
if value == "true"
|
116
118
|
opts[key] = true
|
@@ -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
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class AffinityGroups < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::AffinityGroup
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_affinity_groups(filters)
|
@@ -2,10 +2,10 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/cluster"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Clusters < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::Cluster
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_clusters(filters)
|
@@ -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
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class InstanceTypes < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::InstanceType
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_instance_types(filters)
|
@@ -2,19 +2,19 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/interface"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Interfaces < Fog::Collection
|
8
|
-
model Fog::Compute::
|
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::
|
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::
|
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"
|
@@ -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
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class OperatingSystems < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::OperatingSystem
|
9
9
|
|
10
10
|
def all
|
11
11
|
load service.list_operating_systems
|
@@ -2,10 +2,10 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/quota"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Quotas < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::Quota
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_quotas(filters)
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require "fog/compute/models/server"
|
2
2
|
|
3
3
|
module Fog
|
4
|
-
module
|
5
|
-
class
|
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::
|
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::
|
78
|
+
@volumes ||= id.nil? ? [] : Fog::Ovirt::Compute::Volumes.new(
|
79
79
|
:service => service,
|
80
80
|
:vm => self
|
81
81
|
)
|
@@ -2,10 +2,10 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/server"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Servers < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::Server
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_virtual_machines(filters)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
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::
|
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::
|
33
|
+
attributes[:volumes] ||= id.nil? ? [] : Fog::Ovirt::Compute::Volumes.new(
|
34
34
|
:service => service,
|
35
35
|
:vm => self
|
36
36
|
)
|
@@ -2,10 +2,10 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/template"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Templates < Fog::Collection
|
8
|
-
model Fog::Compute::
|
8
|
+
model Fog::Ovirt::Compute::Template
|
9
9
|
|
10
10
|
def all(filters = {})
|
11
11
|
load service.list_templates(filters)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Fog
|
2
|
-
module
|
3
|
-
class
|
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::
|
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::
|
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
|
@@ -2,18 +2,18 @@ require "fog/core/collection"
|
|
2
2
|
require "fog/ovirt/models/compute/volume"
|
3
3
|
|
4
4
|
module Fog
|
5
|
-
module
|
6
|
-
class
|
5
|
+
module Ovirt
|
6
|
+
class Compute
|
7
7
|
class Volumes < Fog::Collection
|
8
|
-
model Fog::Compute::
|
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::
|
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::
|
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
|