We no longer need much of the functionality this was providing.
Change-Id: I0f625b714950a712249757906974715358f9e6c6
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The 'obj_tree_get_versions' function is used by e.g. the
'test_compatibility_routines' fixture to sanity check object versioning
and we don't do things like remove objects that are referenced
elsewhere. Unfortunately if we do this exact thing, an unhelpful
'IndexError' is raised. Handle things better and raise a specific
exception with hints towards what may be the root cause.
Change-Id: I7c05c648a9efb018ef9718fa31a9cc075482db59
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Closes-bug: #1860652
The latest version of Incompatible check exception Shows
in the exception output but the supported version is not listed.
Change-Id: Ia9f433342b1b233e119613470a829608085de10c
Related-Bug: 1773393
safe_utils.getcallargs was written to support python2.6 which did not
have inspect.getcallargs. Now that support for python2.6 has been
dropped it should be replaced with inspect.getcallargs.
Note:The interface that safe_utils.getcallargs provides did not match
inspect.getcallargs around the handling of the self parameter needing to
be passed in. It should be brought inline with inspect.getcallargs so
that it can be dropped. Nova fixed in 2910d75b28afd909af3b4ac392729ac3d5e64b65.
Change-Id: I2fbec0cc4d43b2fc424460b176bf26700f05f44a
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sqeuence of key-pairs[1], these are benefits:
First, it makes the code look neater.
Second, it gains a micro-optimization.
We dropped python 2.6 support, we can leverage this now.
Note: This commit doesn't handle dict constructor with kwargs.
[1]http://legacy.python.org/dev/peps/pep-0274/
Change-Id: Ifca656d516809a6a52cf15bac3f6361e8d83aa58
In obj_make_compatible() of List objects, only child_versions is used.
If obj_relationships is set on a List object, obj_make_compatible()
should also take that into consideration.
This change pulls out common code for finding the desired child version
for backporting, and then changes ObjectListBase's obj_make_compatible()
to check for child_versions first, and if that is empty, will use
obj_relationships for finding the child version.
Change-Id: I89217f1721c896bd2660354d4f4283e2e12ebe98
Closes-Bug: #1470617
This patch add validation on the target_version arg as following:
1. When target_version == object version don't call obj_make_compatible
2. When target_version > object version raise exception
Change-Id: I0f8dbe3cbdb86752f026f3692d4badc9f6e693c3
* Replace dict.iteritems() with dict.items() in code handling errors in
the exception module to fix Python 3 support.
* Add new unit tests on the exception module
Change-Id: Ib958421dbdd73fb442e17a8d0654c9eab8b7b70e
Currently, objects will directly instantiate the EnumField
class, passing in the list of valid enum values. This is
sub-optimal as the same enum type may be needed in several
objects, and we want to ensure we're always using the same
list of valid values.
To address this, introduce a BaseEnumField class that provides
the custom __repr__() impl based on the enum values. Make the
existing EnumField subclass this, to allow for continued use
of anonymous enum fields, but discourage its use in favour of
creating named enum fields by directly subclassing BaseEnumField
Change-Id: I83199b0f791d3ac5591c7dfc1d14f4fa706d0a64
In some case, one field should be limited to some value, like the
cpu architect field.
Make sure that when the value limitation is changed,
the fingerprint will be changed, so that a version bump should happen.
Ported (but changed for consistency) from:
I7848f8b934c169a76b1cfd875f7905273f9f914b
Co-Authored-By: yunhong jiang <yunhong.jiang@intel.com>
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Change-Id: Iac498869d10d2238b3ddf704640cd152cb794099
Update the version of hacking to the one released for kilo, and fix
issues with code formatting that cause the new hacking checks to fail.
Change-Id: I4c9906df3e71f33b5a13e1f68584d445d79daceb
Lot of projects use fatal_exception_format_errors, we
need to separate out ours in its own group.
Closes-Bug: #1433647
Change-Id: I7a53ed2c5b2387214c4edba7295cb800e12f47a9
Make the tests run under Python 3.4.
Tests now work with random hash seed.
Change-Id: I5f9f57e0bef2c015ab2ff4b5732ccdade5d3bfbe
Closes-Bug: 1417279
Closes-Bug: 1417285
Remove remaining references to "Nova" where possible, code cleanup.
Also removed IP fields
Co-Authored-By: Michal Jastrzebski (inc0) <michal.jastrzebski@intel.com>
Change-Id: Ibad8f9fc6453321055029ad69b0374261509b9d5
Closes-Bug: 1417287
Fix py26 compatibility by removing dict comprehension
Remove history.rst from docs generation since it causes an error
Change-Id: Iedc6e6caa6fe2650c83683347c5d9ddcb4d105e8
Closes-Bug: 1420302
Closes-Bug: #1420372
Co-Authored-By: Dan Smith <dansmith@redhat.com>
Remove extraneous utility code and tests.
Skip tests related to remote object verification until we can rewrite
them (see the adopt-oslo-versionedobjects spec for details).
Fix pep8 errors.
Update requirements.
Set python's hash seed in tox.ini for tests that compare things that
might come out in a different order.