Skip to content

Commit

Permalink
Remove logger warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 committed May 20, 2024
1 parent f86264c commit 9e7394f
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/helpers/proxmox_vm_attrs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})
Expand Down
1 change: 0 additions & 1 deletion app/helpers/proxmox_vm_cloudinit_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion app/helpers/proxmox_vm_volumes_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 0 additions & 3 deletions app/models/foreman_fog_proxmox/proxmox_vm_new.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,13 @@ 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'
new_typed_vm(new_attr, type)
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|
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<% 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') } %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ along with ForemanFogProxmox. If not, see <http://www.gnu.org/licenses/>. %>
<%= 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}) %>

0 comments on commit 9e7394f

Please sign in to comment.