diff --git a/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb b/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb index 8287cb81f..141c0ba19 100644 --- a/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb +++ b/app/models/foreman_fog_proxmox/proxmox_vm_commands.rb @@ -31,11 +31,13 @@ def start_on_boot(vm, args) vm end + # rubocop:disable Metrics/AbcSize def create_vm(args = {}) vmid = args[:vmid].to_i type = args[:type] node = client.nodes.get(args[:node_id]) vmid = node.servers.next_id.to_i if vmid < 1 + args[:vmid] = vmid.to_s if args[:vmid].nil? raise ::Foreman::Exception, format(N_('invalid vmid=%s'), vmid: vmid) unless node.servers.id_valid?(vmid) image_id = args[:image_id] @@ -54,6 +56,7 @@ def create_vm(args = {}) destroy_vm id.to_s + '_' + vm.vmid.to_s if vm raise e end + # rubocop:enable Metrics/AbcSize def compute_clone_attributes(args, container, type) args = parse_cloudinit_config(args) if args[:user_data]