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 object model and generally clean up #3
Open
berrange
wants to merge
9
commits into
jaypipes:master
Choose a base branch
from
berrange:object-model-2
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The existing VIF types are to be deprecated once new VIF types have been formally defined by os_vif. There will be a transition period where compat plugins are needed for use with existing deployments. These compat plugins can continue to live in the Nova libvirt directory until they are deleted. All new plugins will be provided directly by vendors in their own python packages.
There will be no plugins bundled with the os_vif library itself. Modern plugins will be bundled by Neutron vendors in separate python packages. Plugins for legacy VIF types willl be bundled by Nova, until they are deleted. Providing network helper APIs in the os_vif places undesirable burden on os_vif maintainers to provide a stable API for this code which has historically always been internal use only from Nova. Where there is a need for code sharing for setup of host OS networking pieces, it is intended that standalone python modules be built and provided in pypi for reuse by the broader ecosystem. This allows them to be maintained independantly of os_vif instead of tieing them together.
Instead of accepting an arbitrary string for the address field in a VIF object, formally validate it as a MAC address
The word "type" is quite overloaded so it is often not obvious what people are referring to when they say "type". Change the VIF object field "type" to be called "plugin" so that it more explicitly denotes an OS-VIF plugin name.
There are initially 5 core VIF backend class defined, which are sufficient to cover all the current usage in the libvirt driver and some usage in other drivers. It is expected that a couple more may be added for vmware/hyperv.
Rename the base.py file to plugin.py since it will have more than just the base class defined in it. Rather it defines the overall plugin API contract
Rather than allowing unspecified arbitrary dict passthrough, define an explicit plugin configuration object to pass to plugins.
Make the os-vif library independent of the the Nova object model by introducing an InstanceConfig object. This allows it to be used by projects such as Kuryr.
Add a get_supported_vifs() method to the PluginBase class which returns info on which os_vif.objects.VIFBase subclasses are supported by the plugin, and associated version ranges. A method is used, rather than a static attribute, since plugins may wish to dynamically decide which VIFs are supported based on some aspect of the host OS/hypervisor configuration/feature set.
|
||
|
||
class MACAddressField(object_fields.AutoTypedField): | ||
AUTO_TYPE = MACAddress() |
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.
Above added to o.vo mainline here: https://review.openstack.org/#/c/245294/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This series of patches does a number of things