Integration library between network (Neutron) and compute (Nova) providers
Go to file
Jan Gutter c90081bb94 Clean up versioned object backlevelling code
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
2019-02-21 11:07:26 +00:00
doc Extend port profiles with datapath offload type 2019-01-14 17:23:22 +02:00
os_vif Clean up versioned object backlevelling code 2019-02-21 11:07:26 +00:00
playbooks/os-vif-ovs move legacy-tempest-dsvm-nova-os-vif to repo 2018-07-06 08:08:54 +02:00
releasenotes do not always plug ovs ports. 2019-01-18 19:10:58 +00:00
vif_plug_linux_bridge Add support for Windows network commands 2018-09-26 14:40:21 +01:00
vif_plug_noop add noop plugin 2018-07-05 16:20:22 +00:00
vif_plug_ovs Merge "Convert hardcoded regexes to raw strings for py36" 2019-02-20 04:12:12 +00:00
.coveragerc Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
.gitignore Git ignore .stestr 2018-01-15 16:18:50 +01:00
.gitreview Added .gitreview 2015-11-11 16:10:58 +00:00
.mailmap Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
.stestr.conf Migrate from 'ip' commands to 'pyroute2' 2018-01-08 10:17:42 +00:00
.testr.conf Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
.zuul.yaml Change python3.5 job to python3.7 job on Stein+ 2019-02-19 16:07:46 +00:00
CONTRIBUTING.rst Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
HACKING.rst Reflow docs to 79 columns 2018-10-11 16:40:54 +02:00
LICENSE Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
README.rst Add release note link in README 2018-06-27 15:52:27 +00:00
babel.cfg Import of code from https://github.com/jaypipes/os_vif 2016-01-13 12:56:01 -05:00
lower-constraints.txt Remove IPTools deprecated implementation 2018-10-09 08:58:06 +01:00
requirements.txt Extend port profiles with datapath offload type 2019-01-14 17:23:22 +02:00
setup.cfg Change openstack-dev to openstack-discuss 2018-12-03 21:00:54 -05:00
setup.py Updated from global requirements 2017-03-10 19:12:21 +00:00
test-requirements.txt Update hacking version 2019-01-07 11:04:24 +08:00
tox.ini Change python3.5 job to python3.7 job on Stein+ 2019-02-19 16:07:46 +00:00

README.rst

Team and repository tags

image

os-vif

Latest Version

Downloads

A library for plugging and unplugging virtual interfaces in OpenStack.