Skip to content

Commit

Permalink
Infer the vlan_id from the interface name
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Sep 15, 2020
1 parent 741d0b1 commit 12618fd
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class Vlan < Base
# @see Y2Network::Sysconfig::ConnectionConfigReaders::Base#update_connection_config
def update_connection_config(conn)
conn.parent_device = file.etherdevice
conn.vlan_id = file.vlan_id
conn.vlan_id = vlan_id_for(file)
end

def vlan_id_for(file)
file.vlan_id || file.interface.split(".")[1].to_i
end
end
end
Expand Down

0 comments on commit 12618fd

Please sign in to comment.