Module: ProxmoxVmOsTemplateHelper

Included in:
ProxmoxVmHelper
Defined in:
app/helpers/proxmox_vm_os_template_helper.rb

Instance Method Summary collapse

Instance Method Details

#ostemplate_keysObject



26
27
28
# File 'app/helpers/proxmox_vm_os_template_helper.rb', line 26

def ostemplate_keys
  ['ostemplate_storage', 'ostemplate_file']
end

#parse_container_ostemplate(args) ⇒ Object



40
41
42
43
# File 'app/helpers/proxmox_vm_os_template_helper.rb', line 40

def parse_container_ostemplate(args)
  ostemplate = args['ostemplate'] || args['ostemplate_file']
  { ostemplate: ostemplate }
end

#parse_ostemplate(args, config) ⇒ Object



34
35
36
37
38
# File 'app/helpers/proxmox_vm_os_template_helper.rb', line 34

def parse_ostemplate(args, config)
  ostemplate = parse_ostemplate_without_keys(args)
  ostemplate = parse_ostemplate_without_keys(config) unless ostemplate[:ostemplate]
  ostemplate
end

#parse_ostemplate_without_keys(args) ⇒ Object



30
31
32
# File 'app/helpers/proxmox_vm_os_template_helper.rb', line 30

def parse_ostemplate_without_keys(args)
  parse_container_ostemplate(args.select { |key, _value| ostemplate_keys.include? key })
end