-
Notifications
You must be signed in to change notification settings - Fork 34
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
propose new object API for devices #128
Conversation
Looking only at the proposed usage so far: using |
@mvidner you mean that before start must be explicit |
Network is not only about devices configuration. It contains also routing, dns, hostname, ... |
@mchf I know, I want to extend object modul to reflect real state when it is needed. This way it contain only used stuff and allow us to do it evolution way ( so splitting model when it is too big, define it more precise when needed, etc. ) |
Well, in current state I would prefer (take it as very fresh ideas): As a summary. I would redefine / reimplement network's architecture firstly and then try to identify new API. |
@mchf - OK, sounds reasonable. So what steps you prefer for my task ( try dhcp for all network cards and keep it for all that have global address )? We can discuss it on IRC or on phone. |
@jreidinger in current state you'll need:
|
OK, sounds reasonable
If I check https://github.com/yast/yast-network/blob/master/src/include/network/lan/cmdline.rb#L240 how CLI do it, then it is around 40 lines of code for such simple task
It would be enough if it exist :) My checking code looks like I need to call
Does it use new configuration? @mvidner propose to use ifup What is missing in your proposal is
any proposal how achieve that? |
Maybe @mchf 's opposition comes from thinking that the initial example is a total rewrite of |
OK, lets discuss it in person when @mchf will be in office. |
Re Other than this detail I really like this approach. One of the biggest mistakes in the current code is not having a consistent way of OOP so a clean new API will help a lot (even though underneath it may be messy). |
IIRC we decided in person to postpone this after SLE12 So what are the next steps 1) in the big picture 2) for this PR? BTW this API was motivated by the need to implement https://github.com/yast/yast-network/blob/6d6f9da7c5324143ca5e3dc04a230f67af544a3f/src/clients/inst_setup_dhcp.rb |
lets close it for now. We will reopen when there is time for it. |
Hi,
I propose new API for network for purpose of new installer and as I hope good enough to replace in future old API, which is really unintuitive.
example usage as I see it for NI simple task ( for each device try to set up DHCP, start it and if it not work, then stop it and remove DHCP config )
in future we can improve when there is use case for it (I have in mind modules to extend configuration for specific devices with proper object hierarchy or Factory pattern for device, so it can be much easier cached).
@mchf @mvidner opinions?