c90081bb94
The backlevelling code for the VIF objects have a number of sharp edges. This commit changes the layout of the obj_make_compatible methods to conform to a fixed pattern. Given the following version history: # Version 1.0: Initial Release based on ParentClass 1.0 # Version 1.1: Added member_one_one # Version 1.2: ParentClass version increased to 1.1 from 1.0 # Version 1.3: Added member_one_three # Version 1.4: ParentClass version increased to 1.2 from 1.1 # Version 1.5: Added member_one_five Use the following pattern for obj_make_compatible(): 0. use versionutils to calculate target_version 1. Remove added members from the primitive in reverse order: - if target_version < (1, 5) and 'member_one_five' in primitive: del primitive['member_one_five'] - if target_version < (1, 3) and 'member_one_three' in primitive: del primitive['member_one_three'] - if target_version < (1, 1) and 'member_one_one' in primitive: del primitive['member_one_one'] 2. Call the parent method explicitly when the parent class caused a version bump in this object, in the following if/elif tree: - if target_version < (1, 2): super(MyClass, self).obj_make_compatible(primitive, '1.0') - elif target_version < (1, 4): super(MyClass, self).obj_make_compatible(primitive, '1.1') 3. Finally, if target_version is recent enough, call the parent method with the current version of the parent class: - else: super(MyClass, self).obj_make_compatible(primitive, '1.2') This pattern has been documented in: https://review.openstack.org/632321/ Change-Id: Ib7b0cca596c0cad8095ef18243b94ada2587d1cd Signed-off-by: Jan Gutter <jan.gutter@netronome.com> blueprint: generic-os-vif-offloads |
||
---|---|---|
doc | ||
os_vif | ||
playbooks/os-vif-ovs | ||
releasenotes | ||
vif_plug_linux_bridge | ||
vif_plug_noop | ||
vif_plug_ovs | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.stestr.conf | ||
.testr.conf | ||
.zuul.yaml | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
babel.cfg | ||
lower-constraints.txt | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tox.ini |
README.rst
Team and repository tags
os-vif
A library for plugging and unplugging virtual interfaces in OpenStack.
- License: Apache License, Version 2.0
- Documentation: https://docs.openstack.org/os-vif/latest/
- Source: https://git.openstack.org/cgit/openstack/os-vif
- Bugs: https://bugs.launchpad.net/os-vif
- Release Notes: https://docs.openstack.org/releasenotes/os-vif