New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proof of concept #782
Proof of concept #782
Conversation
Cleanup: Remove dead code and small fixes
New data model for routing
Its result was overwritten a few lines later
@@ -1471,7 +1471,7 @@ def FormatOverview | |||
overviews[iface.name] = {} | |||
rich = "" | |||
|
|||
descr = iface.name | |||
descr = iface.hardware.description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Virtual interfaces do not have have harward info, ins't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well ... depends. As I see it hwinfo
provides more a kind of "driver" information provided by kernel. So, if you use hwinfo --network
instead of hwinfo --netcard
you'll see that (e.g.) vlan device can be found like on one of my test VM:
17: None 00.0: 10701 Ethernet
[Created at net.126]
Unique ID: +HKJ.ndpeucax6V1
Parent ID: rBUF.GkSpXDNdaaB
SysFS ID: /class/net/vlan0
Hardware Class: network interface
Model: "Ethernet network interface"
Driver: "802.1Q VLAN Support"
Device File: vlan0
HW Address: 08:00:27:57:ed:fe
Permanent HW Address: 08:00:27:57:ed:fe
Link detected: yes
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #5 (Ethernet controller
On the other hand yast2-network currently queries only for -netcard
which do not show the vlan device in this case.
I only try to separate access to LanItems::Items
and wrap it to some objects here. It definitely is not perfect so far and needs some love. On the other hand the piece of code you refer to is a direct "translation" of old code into new - in original code it simply put empty string into descr
when corresponding hwitem field (hwinfo["name"]
- a textual description of device like "Intel 82546 controller") was not available for the device.
name has to be attr_reader - used as an id and renaming of an interface requires additional actions anyway improved configured initialization when creating the object
in network-ng interfaces are encapsulated in objects and routing refers to this objects -> no need to explicitly touch routes
as well as the Add interface workflow does
Rebased this patch on top of updated network-ng branch -> reopening as a new pull request |
Purpose was to replace the LanItems::Items beast with something like objects and then start the yast lan module and see devices listed as expected.
This was (with one minor issue in name column) achieved with this patch.
Next steps:
Enable as much tests as possible(now only tests tightly related toBuildLanOverview
are disabled)