From 19d5b22f45b91afe4a18a3913be5ec721f13e875 Mon Sep 17 00:00:00 2001 From: Enzo Hamelin Date: Mon, 3 Dec 2018 18:02:30 +0100 Subject: [PATCH] Templates method are now in Real.rb not in servers model --- app/models/foreman_xen/xenserver.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/foreman_xen/xenserver.rb b/app/models/foreman_xen/xenserver.rb index 0775cb0..6b7623c 100644 --- a/app/models/foreman_xen/xenserver.rb +++ b/app/models/foreman_xen/xenserver.rb @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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'