- Primary Maintainer:
- Dan Smith
- Other Contributors:
- Chris Behrens
The nova.objects package abstracts versionable internal objects for use with RPC.
Rather than moving this code into the incubator, I propose that we move it directly to a new library. The code has been around long enough that the API is reasonably stable.
These projects are already using the code:
The divergence in Ironic is minimal and their version is generally slightly behind nova, as new things are only copied over as needed.
The public API is relatively well-defined at this point. Major elements consist of:
The following things are fairly nova-specific and should be left in the Nova tree (for now at least):
Things that are public now (or, too public for a library) that should be made private:
Things that need some definition that are currently rather obscure and nova-centric:
The service and conductor code will be left out of the initial import, and the tests using it commented out. Fixing those tests will be a high priority item before we release.
Finally, there is one detail of the implementation that deserves some thought before we codify it in a library. Right now, the simple act of subclassing NovaObject will register the implementation in the registry, via the metaclass. This is convenient because the author doesn’t have to do anything in order to use their implementation immediately. However, it may be a little “too magic” or “too automatic”. If you want to subclass NovaObject but not register it, there is currently no way to do that. We could have an unregister function, but then it’s impossible to avoid the small window of being registered. The unit tests currently have some weirdness because of this, for their test objects.
The alternate proposal for registration would be a simple class decorator that you apply to objects that you wish to be registered.
Target Milestone for completion: kilo-2
Adoption will include synchronization with changes that may be going into Nova at the same time until the point at which nova can move to using the oslo library.
#!/bin/bash # Depends on refactored graduation scripts found # in https://review.openstack.org/#/c/151027/ set -ex (cd nova && git checkout master && git pull) new_repo=oslo.versionedobjects-$(date +%Y-%m-%d-%H%M) git clone nova $new_repo cd $new_repo tooldir=~/repos/openstack/oslo-incubator/tools FILES=" nova/exception.py nova/objects/__init__.py nova/objects/base.py nova/objects/fields.py nova/test.py nova/tests/fixtures.py nova/tests/unit/objects/__init__.py nova/tests/unit/objects/test_fields.py nova/tests/unit/objects/test_objects.py nova/tests/unit/test_utils.py nova/safe_utils.py nova/utils.py " $tooldir/filter_git_history.sh $FILES git mv nova oslo_versionedobjects git mv oslo_versionedobjects/objects/* oslo_versionedobjects/ rmdir oslo_versionedobjects/objects git mv oslo_versionedobjects/tests/unit/objects/* oslo_versionedobjects/tests/ rmdir oslo_versionedobjects/tests/unit/objects git mv oslo_versionedobjects/tests/unit/test_utils.py oslo_versionedobjects/tests/ rmdir oslo_versionedobjects/tests/unit $tooldir/apply_cookiecutter.sh versionedobjects cat - >requirements.txt <<EOF six>=1.7.0 Babel>=1.3 netaddr>=0.7.12 oslo.concurrency>=1.4.1 # Apache-2.0 oslo.context>=0.1.0 # Apache-2.0 oslo.messaging>=1.4.0,!=1.5.0 oslo.serialization>=1.2.0 # Apache-2.0 oslo.utils>=1.2.0 # Apache-2.0 iso8601>=0.1.9 EOF cat - >test-requirements.txt <<EOF hacking>=0.5.6,<0.8 oslotest>=1.2.0 # Apache-2.0 mock>=1.0 testtools>=0.9.36,!=1.2.0 # These are needed for docs generation oslosphinx>=2.2.0 # Apache-2.0 sphinx>=1.1.2,!=1.2.0,!=1.3b1,<1.3 EOF echo echo "Output in $(pwd)" exit $? # oslo-incubator modules: # versionutils
This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode