diff --git a/app/models/foreman_fog_proxmox/proxmox_interfaces.rb b/app/models/foreman_fog_proxmox/proxmox_interfaces.rb index 9d98125a5..7f5a1a665 100644 --- a/app/models/foreman_fog_proxmox/proxmox_interfaces.rb +++ b/app/models/foreman_fog_proxmox/proxmox_interfaces.rb @@ -118,7 +118,7 @@ def dhcp?(nic_compute_attributes, v6 = false) def set_mac(nic_compute_attributes, mac, type) mac_attr_name = { 'qemu' => :macaddr, 'lxc' => :hwaddr } mac_key = mac_attr_name[type] || 'mac' - nic_compute_attributes[mac_key] = Net::Validations.normalize_mac(mac) + nic_compute_attributes[mac_key] = Net::Validations.normalize_mac(mac).upcase end def host_interfaces_attrs(host) diff --git a/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb b/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb index 7e4365a88..0115eff2c 100644 --- a/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb +++ b/test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb @@ -54,7 +54,7 @@ class ProxmoxInterfacesTest < ActiveSupport::TestCase it 'sets interface identifier with server compute id, ip and ip6 and mac adress' do ip = '192.168.56.100' - mac_address = '36:25:8c:53:0c:50' + mac_address = '36:25:8C:53:0C:50' ip6 = Array.new(4) { format('%s', x: rand(16**4)) }.join(':') + '::1' compute_attributes = ActiveSupport::HashWithIndifferentAccess.new({ 'id' => 'net0' }) physical_nic = FactoryBot.build(:nic_base_empty, :identifier => 'net0', :ip => ip, :ip6 => ip6, @@ -131,7 +131,7 @@ class ProxmoxInterfacesTest < ActiveSupport::TestCase it 'sets container compute ip DHCP, mac adress and firewall' do ip = '192.168.56.100' - mac_address = '36:25:8c:53:0c:50' + mac_address = '36:25:8C:53:0C:50' ip6 = '2001:0:1234::c1c0:abcd:876' firewall = '1' compute_attributes = ActiveSupport::HashWithIndifferentAccess.new({ 'id' => 'net0', 'dhcp' => '1',