-
Notifications
You must be signed in to change notification settings - Fork 19
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
Refactor common network shared code into package #76
Comments
Looking good. I assume that you mean
Do we expect that e.g. ACI modules will also move their common library from module_utils/aci.py to module_utils/network/aci.py ? |
Answer: No. The new new directory is for code shared by multiple platforms |
Thanks, corrected in the proposal
Only if there are things that are truly common across anything network related. For instance, one thing that might common is functions for manipulating IP address information. |
+1 to proposal
|
I have updated the proposal to include a comment about what type of code should reside in
|
Yes
Yes, I don't anticipate much push back in getting this approved so the implementation can start very early.
Its a fair ask. I will go investigate and respond here |
Will also need documenting in https://github.com/ansible/ansible/blob/devel/docs/docsite/rst/porting_guide_2.5.rst (create developers section under networking) |
Proposal updated with comment |
Code moved from plugins/filters/network.py will need to be relicensed. |
Proposal updated with comment about re-licensing |
This seems like a good long term move, but in terms of priorities where does this fit? To me there are more pressing issues. |
Ken, let's collect a list of stuff that people think is important on the Wiki at: https://github.com/ansible/community/wiki/Network:Core-community-plan Having an overview of what people think is needed will help in structuring possible areas of attention and is helpful even for new or existing work. For the Windows Working Group this really helped solve some misconceptions, find areas that need improvement (docs, community), and bring in new ideas. That said, people are always free to work on what they like or need themselves. It helps if we have a consensus of what we want, and how to get there. And the more people joining that conversation, the better the result. |
For Windows we started off using Etherpad, which is very good for collaborating on content, but very bad for synthesizing that information. So we ended up moving everything into the Wiki. Maybe we could do the same for the Network WG ? The Github Wiki is very (very, very) bad at concurrent access so probably Etherpad is best to start from. |
Agreed, I think @gundalow was collecting all of our initial comments. (Correct me if I am wrong) |
I thought that was more about how the Network WG could be improved. |
@itdependsnetworks I was mainly collecting feedback around the Working Group process, no about specific development tasks. |
|
So, there's an argument wrt. if module_utils/network/ is to be used for all network-related libraries or only the generic libraries. Since the name is quite generic "network" and we have a lot of vendor-specific libraries in module_utils/ it is probably wise to have a similar structure in module_utils/ as we already have established in modules/ which means avi.py would live in module_utils/network/. |
Holding this for one more week before finalizing to address @dagwieers comments. Original proposal is to create a package that does not include platform specific code but only common shared code for network modules. Idea to change the package name to one of the following:
Amendment on the table to create a structure that more reflects the |
After having some one off individual discussions, proposal has been updated to move forward with the following packaging:
|
@privateip Perfect as that will work much better with how ansibot is designed. With this scheme it will automatic label PRs with files in these directories. |
AGREED in Network IRC meeting Wednesday 4th Oct |
how does the proposal accommodate cases where the following occurs. bigip_* and bigiq_* share code amongst themselves (classes, functions, constants). One does not want to copy the module code from one to the other Would any of the following be true? (examples are directories unless otherwise specified). Which of the following would be preferred Case 1 Case 2 Case 3 Case 4 |
Case 2 would be the preferred, imho |
…e (part-1) As per proposal ansible#76 refactor common network shared and platform specific code into sub-package. ansible/proposals#76 * ansible.module_utils.network.common - command shared functions * ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions
…e (part-1) As per proposal ansible#76 refactor common network shared and platform specific code into sub-package. ansible/proposals#76 * ansible.module_utils.network.common - command shared functions * ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions * Fix review comments
…33452) * Refactor common network shared and platform specific code into package (part-1) As per proposal #76 refactor common network shared and platform specific code into sub-package. ansible/proposals#76 * ansible.module_utils.network.common - command shared functions * ansible.module_utils.network.{{ platform }} - where platform is platform specific shared functions * Fix review comments * Fix review comments
* As per proposal ansible/proposals#76 deprecate use of Entity, EntityCollection, ComplexDict, ComplexList and use subspec instead. * Refactor ios modules * Refactor eos modules * Refactor vyos modules * Refactor nxos modules * Refactor iosxr modules * Add support for key in suboptions handling
…#33575) * Deprecate Entity, EntityCollection and use subspec in network modules * As per proposal ansible/proposals#76 deprecate use of Entity, EntityCollection, ComplexDict, ComplexList and use subspec instead. * Refactor ios modules * Refactor eos modules * Refactor vyos modules * Refactor nxos modules * Refactor iosxr modules * Add support for key in suboptions handling * Fix CI issues
Code is complete (thanks @ganeshrn) |
For reference, new packages are live and can be found in https://github.com/ansible/ansible/tree/devel/lib/ansible/module_utils/network |
Done as part of PR ansible/ansible#33452 |
Date: 2017/9/21
Motivation
The rapid pace of module development for network modules has amassed a significant amount of technical debt related to the network shared code found in
ansible/module_utils
. This proposal is designed to provide details on creating a stable network package inansible/module_utils/network
and move the current shared network libraries into the new package. Theansible.module_utils.network
package will only contain shared code that is common for all network modules to implement and will be maintained in a stable way moving forward.[edit]
Amending this proposal to include a note of clarification. The only code that will live in the newly proposed package would be things that are truly platform agnostic and shareable across any and all network modules. This means there should be no platform specific code in this package
Problems
What problems exist that this proposal will solve?
What problems exist that this proposal will solve?
ansible.module_utils.network
)Solution proposal
In order to solve the problems mentioned above, this proposal will refactor a number of shared functions that currently reside in module_utils. The goal for the refactoring will be to introduce changes only where necessary to complete the refactor. All of the current functions in module_utils will remain and be deprecated per community process so as to provide backwards compatibility.
In order to solve the current problem, the following is proposed:
module_utils/netcfg.py
intomodule_utils/network/config.py
CustomNetworkConfig
module_utils/network_common.py
intomodule_utils/network/common.py
Entity
,EntityCollection
,ComplexDict
,ComplexList
(all can be replaced by subspecs)module_utils/network/parsing.py
module_utils/netcli.py
plugins/filters/network.py
(no change in function this is just moving code around)module_utils/netcfg.py
module_utils/network_common.py
module_utils/network.py
module_utils/netcli.py
module_utils/network
module_utils/network
Performing this work will help to stabilize the common code base used for developing network modules and add the missing test cases. Once completed new changes introduced into
ansible.module_utils.network
will be done to maintain backwards compatibility, keep the package stable and well documented.Dependencies (optional)
Testing (optional)
See comments in proposal around testing
Documentation (optional)
See comments in proposal around documentation
Anything else?
The text was updated successfully, but these errors were encountered: