Skip to content

Commit

Permalink
fix: Fix network interface capitalize issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Manisha15 committed Aug 1, 2024
1 parent a40c106 commit 05217ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/models/foreman_fog_proxmox/proxmox_interfaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions test/unit/foreman_fog_proxmox/proxmox_interfaces_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('%<x>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,
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 05217ce

Please sign in to comment.