diff --git a/app/helpers/proxmox_vm_attrs_helper.rb b/app/helpers/proxmox_vm_attrs_helper.rb index ad649fba8..1ce1d1b1a 100644 --- a/app/helpers/proxmox_vm_attrs_helper.rb +++ b/app/helpers/proxmox_vm_attrs_helper.rb @@ -37,7 +37,7 @@ def object_to_attributes_hash(vm, from_profile, cr) interfaces = Hash[vm.config.interfaces.each_with_index.map do |interface, idx| [idx.to_s, interface_compute_attributes(interface.attributes)] end ] - #server = cr.new_typed_vm(vm.attributes, 'qemu') + server = cr.new_vm(vm.attributes) vm.config.all_attributes.each do |key, value| if key == :interfaces vm_h.merge!({key => {:name => "#{paramScope}[interfaces_attributes]", :value => interfaces }}) diff --git a/app/helpers/proxmox_vm_cloudinit_helper.rb b/app/helpers/proxmox_vm_cloudinit_helper.rb index 11221820c..f1601d57f 100644 --- a/app/helpers/proxmox_vm_cloudinit_helper.rb +++ b/app/helpers/proxmox_vm_cloudinit_helper.rb @@ -48,7 +48,6 @@ def create_cloudinit_iso(vm_name, configs, ssh) wd = create_temp_directory(ssh) configs.each do |config| - Rails.logger.warn("***************** config clouinit #{config[1]}") config_file = ssh.run(%(echo '#{config[1]}' >> "#{wd}/#{config[0]}")) unless config_file.first.status.zero? delete_temp_dir(ssh, wd) diff --git a/app/helpers/proxmox_vm_volumes_helper.rb b/app/helpers/proxmox_vm_volumes_helper.rb index d97213151..2221bea64 100644 --- a/app/helpers/proxmox_vm_volumes_helper.rb +++ b/app/helpers/proxmox_vm_volumes_helper.rb @@ -45,7 +45,6 @@ def parsed_typed_volumes(args, type, parsed_vm) end volumes = parse_typed_volumes(volumes_attributes, type) volumes.each { |volume| parsed_vm = parsed_vm.merge(volume) } - logger.warn("**************************** parse_typed_volumes #{volumes} ......... #{parsed_vm}") parsed_vm end diff --git a/app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb b/app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb index cfe84495c..9e18a56c8 100644 --- a/app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb +++ b/app/models/foreman_fog_proxmox/proxmox_compute_attributes.rb @@ -49,7 +49,6 @@ def interface_compute_attributes(interface_attributes) def vm_compute_attributes(vm) vm_attrs = {} - logger.warn("********************* vm comp attrs are vm #{vm}") vm_attrs = vm_attrs.merge(vmid: vm.identity, node_id: vm.node_id, type: vm.type) if vm.respond_to?(:config) if vm.config.respond_to?(:disks) diff --git a/app/models/foreman_fog_proxmox/proxmox_vm_new.rb b/app/models/foreman_fog_proxmox/proxmox_vm_new.rb index 84d180e08..e8a97c43a 100644 --- a/app/models/foreman_fog_proxmox/proxmox_vm_new.rb +++ b/app/models/foreman_fog_proxmox/proxmox_vm_new.rb @@ -161,7 +161,6 @@ def config_attributes(type = 'qemu') end def new_vm(new_attr = {}) - logger.warn("*************************** new_vm ssattrs #{new_attr}") new_attr = ActiveSupport::HashWithIndifferentAccess.new(new_attr) type = new_attr['type'] type ||= 'qemu' @@ -169,7 +168,6 @@ def new_vm(new_attr = {}) end def convert_config_attributes(new_attr) - logger.warn("*************************** convert config ssattrs #{new_attr}") config_attributes = new_attr[:config_attributes] if config_attributes.key?(:disks) config_attributes[:volumes_attributes] = Hash[config_attributes[:disks].each_with_index.map do |disk, idx| @@ -185,7 +183,6 @@ def convert_config_attributes(new_attr) end def new_typed_vm(new_attr, type) - logger.warn("*************************** new typed vmsattrs #{new_attr}") convert_config_attributes(new_attr) if new_attr.key?(:config_attributes) node_id = new_attr['node_id'] node = node_id ? client.nodes.get(node_id) : default_node diff --git a/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_volumes_edit.html.erb b/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_volumes_edit.html.erb index 6ad78ee5a..85d6c93f2 100644 --- a/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_volumes_edit.html.erb +++ b/app/views/compute_resources_vms/form/proxmox/_add_vm_type_to_volumes_edit.html.erb @@ -26,7 +26,6 @@ along with ForemanFogProxmox. If not, see . %> <% cloud_init = f.object.cloud_init? %> <% logger.debug("_add_vm_type_to_volumes_edit.html cloud_init=#{cloud_init}") %> <% container = type == 'lxc' %> - <% logger.debug("************************************ _add_vm_type_to_volumes_edit.html type=#{type}") %> <%= add_child_link_typed '+ ' + _("Add Hard Disk"), :volumes, 'hard_disk', { :class => "info #{'hide' unless server }", :title => _('add new hard disk') } %> <%= add_child_link_typed '+ ' + _("Add CD-ROM"), :volumes, 'cdrom', { :class => "info #{'hide' if cdrom }", :title => _('add new cd-rom') } %> <%= add_child_link_typed '+ ' + _("Add Cloud-init"), :volumes, 'cloud_init', { :class => "info #{'hide' if cloud_init }", :title => _('add new cloud-init') } %> diff --git a/app/views/compute_resources_vms/form/proxmox/_base.html.erb b/app/views/compute_resources_vms/form/proxmox/_base.html.erb index 7efc751a4..1215379b1 100644 --- a/app/views/compute_resources_vms/form/proxmox/_base.html.erb +++ b/app/views/compute_resources_vms/form/proxmox/_base.html.erb @@ -25,4 +25,5 @@ along with ForemanFogProxmox. If not, see . %> <%= webpacked_plugins_js_for :foreman_fog_proxmox %> <%= javascript_include_tag 'foreman_fog_proxmox/proxmox_vm', "data-turbolinks-track" => true %> <% end %> +<% logger.warn("************************* baseeeeee #{f.object.config}")%> <%= react_component('ProxmoxVmType', { vm_attributes: object_to_attributes_hash(f.object, from_profile, compute_resource), nodes: nodes, images: images, pools: compute_resource.pools, storages: compute_resource.storages(f.object.node_id), from_profile: true, new_vm: new_vm}) %>