Skip to content
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

Closed
wants to merge 251 commits into from
Closed

Proof of concept #782

wants to merge 251 commits into from

Conversation

mchf
Copy link
Member

@mchf mchf commented Apr 11, 2019

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:

  1. Objects from the patch need some love now.
  2. Enable as much tests as possible (now only tests tightly related to BuildLanOverview are disabled)

@@ -1471,7 +1471,7 @@ def FormatOverview
overviews[iface.name] = {}
rich = ""

descr = iface.name
descr = iface.hardware.description
Copy link
Contributor

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?

Copy link
Member Author

@mchf mchf Apr 23, 2019

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
@mchf
Copy link
Member Author

mchf commented Apr 30, 2019

Rebased this patch on top of updated network-ng branch -> reopening as a new pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants