Skip to content
This repository has been archived by the owner on Jul 3, 2024. It is now read-only.

Commit

Permalink
Templates method are now in Real.rb not in servers model
Browse files Browse the repository at this point in the history
  • Loading branch information
zozoh94 authored and mmoll committed Dec 3, 2018
1 parent 05c3994 commit 19d5b22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/models/foreman_xen/xenserver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def templates

def templates!
store_in_cache('templates') do
client.servers.templates.sort_by(&:name)
client.templates.sort_by(&:name)
end
end

Expand All @@ -143,7 +143,7 @@ def custom_templates

def custom_templates!
store_in_cache('custom_templates') do
get_templates(client.servers.custom_templates)
get_templates(client.custom_templates)
end
end

Expand All @@ -153,7 +153,7 @@ def builtin_templates

def builtin_templates!
store_in_cache('builtin_templates') do
get_templates(client.servers.builtin_templates)
get_templates(client.builtin_templates)
end
end

Expand All @@ -165,7 +165,7 @@ def find_snapshots_for_vm(vm)
return [] if vm.snapshots.empty?

tmps = begin
client.servers.templates.select(&:is_a_snapshot)
client.templates.select(&:is_a_snapshot)
rescue
[]
end
Expand All @@ -178,7 +178,7 @@ def find_snapshots_for_vm(vm)

def find_snapshots
tmps = begin
client.servers.templates.select(&:is_a_snapshot)
client.templates.select(&:is_a_snapshot)
rescue
[]
end
Expand Down Expand Up @@ -296,7 +296,7 @@ def create_vm_from_builtin(args)

other_config = {}
if builtin_template_name != ''
template = client.servers.builtin_templates.find { |tmp| tmp.name == args[:builtin_template_name] }
template = client.builtin_templates.find { |tmp| tmp.name == args[:builtin_template_name] }
other_config = template.other_config
other_config.delete 'disks'
other_config.delete 'default_template'
Expand Down

0 comments on commit 19d5b22

Please sign in to comment.