fog-ovirt 1.2.2 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +17 -5
- data/Gemfile +0 -1
- data/README.md +2 -6
- data/Rakefile +2 -8
- data/fog-ovirt.gemspec +3 -3
- data/lib/fog/ovirt/compute.rb +5 -29
- data/lib/fog/ovirt/compute/v4.rb +27 -11
- data/lib/fog/ovirt/models/compute/interface.rb +1 -0
- data/lib/fog/ovirt/models/compute/interfaces.rb +0 -2
- data/lib/fog/ovirt/models/compute/server.rb +0 -2
- data/lib/fog/ovirt/models/compute/volume.rb +1 -0
- data/lib/fog/ovirt/models/compute/volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/add_interface.rb +4 -10
- data/lib/fog/ovirt/requests/compute/v4/add_volume.rb +2 -2
- data/lib/fog/ovirt/requests/compute/v4/create_vm.rb +2 -4
- data/lib/fog/ovirt/requests/compute/v4/list_template_volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/list_vm_volumes.rb +0 -2
- data/lib/fog/ovirt/requests/compute/v4/list_vnic_profiles.rb +25 -0
- data/lib/fog/ovirt/requests/compute/v4/mock_files/operating_systems.xml +4 -4
- data/lib/fog/ovirt/requests/compute/v4/mock_files/template.xml +48 -45
- data/lib/fog/ovirt/requests/compute/v4/mock_files/templates.xml +17 -2
- data/lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profile.xml +10 -0
- data/lib/fog/ovirt/requests/compute/v4/mock_files/vnic_profiles.xml +42 -0
- data/lib/fog/ovirt/requests/compute/v4/storage_domains.rb +2 -1
- data/lib/fog/ovirt/requests/compute/v4/update_vm.rb +0 -2
- data/lib/fog/ovirt/version.rb +1 -1
- data/tests/ovirt/requests/compute/v4/client_tests.rb +1 -1
- metadata +18 -95
- data/lib/fog/ovirt/compute/v3.rb +0 -138
- data/lib/fog/ovirt/requests/compute/v3/activate_volume.rb +0 -23
- data/lib/fog/ovirt/requests/compute/v3/add_interface.rb +0 -22
- data/lib/fog/ovirt/requests/compute/v3/add_to_affinity_group.rb +0 -23
- data/lib/fog/ovirt/requests/compute/v3/add_volume.rb +0 -23
- data/lib/fog/ovirt/requests/compute/v3/attach_volume.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/create_affinity_group.rb +0 -20
- data/lib/fog/ovirt/requests/compute/v3/create_vm.rb +0 -20
- data/lib/fog/ovirt/requests/compute/v3/datacenters.rb +0 -22
- data/lib/fog/ovirt/requests/compute/v3/deactivate_volume.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/destroy_affinity_group.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/destroy_interface.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/destroy_vm.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/destroy_volume.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/detach_volume.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/get_affinity_group.rb +0 -20
- data/lib/fog/ovirt/requests/compute/v3/get_api_version.rb +0 -18
- data/lib/fog/ovirt/requests/compute/v3/get_cluster.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/get_instance_type.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/get_quota.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/get_template.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/get_virtual_machine.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/get_volume.rb +0 -19
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_group_vms.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/list_affinity_groups.rb +0 -22
- data/lib/fog/ovirt/requests/compute/v3/list_clusters.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_instance_types.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_networks.rb +0 -18
- data/lib/fog/ovirt/requests/compute/v3/list_operating_systems.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_quotas.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_template_interfaces.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_template_volumes.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_templates.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_virtual_machines.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_vm_interfaces.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_vm_volumes.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/list_volumes.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup.xml +0 -8
- data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroup_vms.xml +0 -9
- data/lib/fog/ovirt/requests/compute/v3/mock_files/affinitygroups.xml +0 -17
- data/lib/fog/ovirt/requests/compute/v3/mock_files/cluster.xml +0 -20
- data/lib/fog/ovirt/requests/compute/v3/mock_files/clusters.xml +0 -39
- data/lib/fog/ovirt/requests/compute/v3/mock_files/data_centers.xml +0 -17
- data/lib/fog/ovirt/requests/compute/v3/mock_files/disks.xml +0 -58
- data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_type.xml +0 -42
- data/lib/fog/ovirt/requests/compute/v3/mock_files/instance_types.xml +0 -197
- data/lib/fog/ovirt/requests/compute/v3/mock_files/nics.xml +0 -10
- data/lib/fog/ovirt/requests/compute/v3/mock_files/operating_systems.xml +0 -10
- data/lib/fog/ovirt/requests/compute/v3/mock_files/quotas.xml +0 -7
- data/lib/fog/ovirt/requests/compute/v3/mock_files/storage_domains.xml +0 -36
- data/lib/fog/ovirt/requests/compute/v3/mock_files/template.xml +0 -39
- data/lib/fog/ovirt/requests/compute/v3/mock_files/templates.xml +0 -110
- data/lib/fog/ovirt/requests/compute/v3/mock_files/vm.xml +0 -52
- data/lib/fog/ovirt/requests/compute/v3/mock_files/vms.xml +0 -152
- data/lib/fog/ovirt/requests/compute/v3/mock_files/volume.xml +0 -21
- data/lib/fog/ovirt/requests/compute/v3/mock_files/volumes.xml +0 -40
- data/lib/fog/ovirt/requests/compute/v3/remove_from_affinity_group.rb +0 -23
- data/lib/fog/ovirt/requests/compute/v3/storage_domains.rb +0 -22
- data/lib/fog/ovirt/requests/compute/v3/update_interface.rb +0 -36
- data/lib/fog/ovirt/requests/compute/v3/update_vm.rb +0 -20
- data/lib/fog/ovirt/requests/compute/v3/update_volume.rb +0 -37
- data/lib/fog/ovirt/requests/compute/v3/vm_action.rb +0 -24
- data/lib/fog/ovirt/requests/compute/v3/vm_start_with_cloudinit.rb +0 -21
- data/lib/fog/ovirt/requests/compute/v3/vm_ticket.rb +0 -19
- data/tests/ovirt/requests/compute/v3/client_tests.rb +0 -31
- data/tests/ovirt/requests/compute/v3/create_vm_tests.rb +0 -17
- data/tests/ovirt/requests/compute/v3/destroy_vm_tests.rb +0 -14
- data/tests/ovirt/requests/compute/v3/list_datacenters_tests.rb +0 -11
- data/tests/ovirt/requests/compute/v3/list_quotas_tests.rb +0 -10
- data/tests/ovirt/requests/compute/v3/list_storage_domains_tests.rb +0 -11
- data/tests/ovirt/requests/compute/v3/update_vm_tests.rb +0 -14
- data/tests/ovirt/requests/compute/v3/update_volume_tests.rb +0 -15
@@ -1,24 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def detach_volume(id, options)
|
7
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
8
|
-
raise ArgumentError, "volume id is a required parameter for detach-volume" unless options.key? :id
|
9
|
-
|
10
|
-
client.detach_volume(id, options[:id])
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
class Mock
|
15
|
-
def detach_volume(id, options)
|
16
|
-
raise ArgumentError, "instance id is a required parameter" unless id
|
17
|
-
raise ArgumentError, "volume id is a required parameter for detach-volume" unless options.key? :id
|
18
|
-
true
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_affinity_group(id)
|
7
|
-
ovirt_attrs client.affinity_group(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class Mock
|
12
|
-
def get_affinity_group(_id)
|
13
|
-
xml = read_xml("affinitygroup.xml")
|
14
|
-
ovirt_attrs OVIRT::AffinityGroup.new(self, Nokogiri::XML(xml).root)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_cluster(id)
|
7
|
-
ovirt_attrs client.cluster(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_cluster(_id)
|
12
|
-
xml = read_xml("cluster.xml")
|
13
|
-
ovirt_attrs OVIRT::Cluster.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_instance_type(id)
|
7
|
-
ovirt_attrs client.instance_type(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_instance_type(_id)
|
12
|
-
xml = read_xml "instance_type.xml"
|
13
|
-
ovirt_attrs OVIRT::InstanceType.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_quota(id)
|
7
|
-
ovirt_attrs client.quota(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_quota(_id)
|
12
|
-
xml = read_xml("quota.xml")
|
13
|
-
ovirt_attrs OVIRT::Quota.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_template(id)
|
7
|
-
ovirt_attrs client.template(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_template(_id)
|
12
|
-
xml = read_xml "template.xml"
|
13
|
-
ovirt_attrs OVIRT::Template.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_virtual_machine(id)
|
7
|
-
ovirt_attrs client.vm(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_virtual_machine(_id)
|
12
|
-
xml = read_xml "vm.xml"
|
13
|
-
ovirt_attrs OVIRT::VM.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def get_volume(id)
|
7
|
-
ovirt_attrs client.disk(id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def get_volume(_id)
|
12
|
-
xml = read_xml("volume.xml")
|
13
|
-
ovirt_attrs OVIRT::Volume.new(self, Nokogiri::XML(xml).root)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_affinity_group_vms(id)
|
7
|
-
client.affinity_group_vms(id).map { |vm| servers.get(vm.id) }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class Mock
|
12
|
-
def list_affinity_group_vms(_id)
|
13
|
-
vms = []
|
14
|
-
Nokogiri::XML(read_xml("affinitygroup_vms.xml")).xpath("/vms/vm/@id").each do |id|
|
15
|
-
xml = Nokogiri::XML(read_xml("vms.xml")).xpath(format("/vms/vm[@id='%<id>s']", id.value)).first
|
16
|
-
vms << ovirt_attrs(OVIRT::VM.new(self, xml))
|
17
|
-
end
|
18
|
-
vms
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_affinity_groups(filters = {})
|
7
|
-
client.affinity_groups(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
class Mock
|
12
|
-
def list_affinity_groups(_filters = {})
|
13
|
-
xml = read_xml("affinitygroups.xml")
|
14
|
-
Nokogiri::XML(xml).xpath("/affinity_groups/affinity_group").map do |ag|
|
15
|
-
ovirt_attrs OVIRT::AffinityGroup.new(self, ag)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_clusters(filters = {})
|
7
|
-
client.clusters(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_clusters(_filters = {})
|
12
|
-
xml = read_xml "clusters.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/clusters/cluster").map do |cl|
|
14
|
-
ovirt_attrs OVIRT::Cluster.new(self, cl)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_instance_types(filters = {})
|
7
|
-
client.instance_types(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_instance_types(_filters = {})
|
12
|
-
xml = read_xml "instance_types.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/instance_types/instance_type").map do |t|
|
14
|
-
ovirt_attrs OVIRT::InstanceType.new(self, t)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_networks(cluster_id)
|
7
|
-
client.networks(:cluster_id => cluster_id)
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_networks(_cluster_id)
|
12
|
-
[]
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_operating_systems
|
7
|
-
client.operating_systems.map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_operating_systems
|
12
|
-
xml = read_xml "operating_systems.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/operating_systems/operating_system").map do |os|
|
14
|
-
ovirt_attrs OVIRT::OperatingSystem.new(self, os)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_quotas(filters = {})
|
7
|
-
client.quotas(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_quotas(_filters = {})
|
12
|
-
xml = read_xml "quotas.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/quotas/quota").map do |q|
|
14
|
-
ovirt_attrs OVIRT::Quota.new(self, q)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_template_interfaces(vm_id)
|
7
|
-
client.template_interfaces(vm_id).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_template_interfaces(_vm_id)
|
12
|
-
xml = read_xml "nics.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/nics/nic").map do |nic|
|
14
|
-
ovirt_attrs OVIRT::Interface.new(self, nic)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_template_volumes(template_id)
|
7
|
-
client.template_volumes(template_id).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_template_volumes(_template_id)
|
12
|
-
xml = read_xml "volumes.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/disks/disk").map do |vol|
|
14
|
-
ovirt_attrs OVIRT::Volume.new(self, vol)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_templates(filters = {})
|
7
|
-
client.templates(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_templates(_filters = {})
|
12
|
-
xml = read_xml "templates.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/templates/template").map do |t|
|
14
|
-
ovirt_attrs OVIRT::Template.new(self, t)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_virtual_machines(filters = {})
|
7
|
-
client.vms(filters).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_virtual_machines(_filters = {})
|
12
|
-
xml = read_xml "vms.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/vms/vm").map do |vm|
|
14
|
-
ovirt_attrs OVIRT::VM.new(self, vm)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Fog
|
2
|
-
module Ovirt
|
3
|
-
class Compute
|
4
|
-
class V3
|
5
|
-
class Real
|
6
|
-
def list_vm_interfaces(vm_id)
|
7
|
-
client.vm_interfaces(vm_id).map { |ovirt_obj| ovirt_attrs ovirt_obj }
|
8
|
-
end
|
9
|
-
end
|
10
|
-
class Mock
|
11
|
-
def list_vm_interfaces(_vm_id)
|
12
|
-
xml = read_xml "nics.xml"
|
13
|
-
Nokogiri::XML(xml).xpath("/nics/nic").map do |nic|
|
14
|
-
ovirt_attrs OVIRT::Interface.new(self, nic)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|