Module: ProxmoxVmCdromHelper

Included in:
ProxmoxVmVolumesHelper
Defined in:
app/helpers/proxmox_vm_cdrom_helper.rb

Overview

Convert a foreman form server hash into a fog-proxmox server attributes hash

Instance Method Summary collapse

Instance Method Details

#parse_server_cdrom(args) ⇒ Object



27
28
29
30
31
32
33
34
# File 'app/helpers/proxmox_vm_cdrom_helper.rb', line 27

def parse_server_cdrom(args)
  cdrom_media = args['cdrom'] if args.key?('cdrom')
  cdrom_image = args['volid'] if args.key?('volid')
  volid = cdrom_image.empty? ? cdrom_media : cdrom_image
  return {} unless volid

  { id: 'ide2', volid: volid, media: 'cdrom' }
end