diff options
author | John Garbutt <john@johngarbutt.com> | 2018-01-09 16:48:57 +0000 |
---|---|---|
committer | Mark Goddard <mark@stackhpc.com> | 2018-01-23 22:58:59 +0000 |
commit | 2cd7232f142373b0744dd42aaf1e6ce0740a1567 (patch) | |
tree | a43542f9c2cf5118b98373def25e317c8444992a /ironic/tests/unit/db/utils.py | |
parent | 248296a4f520a6728f872231f86a6d37ef98575d (diff) | |
download | ironic-2cd7232f142373b0744dd42aaf1e6ce0740a1567.tar.gz |
Add RPC object for traits
Adds a new traits object to expose traits DB operations to the API. It
also adds a new traits field into the node object, with the appropriate
version compatibility logic.
get_node_by_port_addresses is modified to ensure we correctly join in
the tags and traits in that DB call, this avoids a orphaned db object
lazy load style failure.
_set_from_db_object in the base object is modified such that the new
traits object doesn't have to include the dictionary style compatibility
mix-in.
Change-Id: I69403b9875a020fab7a7975810b57bf646417953
Partial-Bug: #1722194
Co-Authored-By: Mark Goddard <mark@stackhpc.com>
Diffstat (limited to 'ironic/tests/unit/db/utils.py')
-rw-r--r-- | ironic/tests/unit/db/utils.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ironic/tests/unit/db/utils.py b/ironic/tests/unit/db/utils.py index 3741d090d..511ad125e 100644 --- a/ironic/tests/unit/db/utils.py +++ b/ironic/tests/unit/db/utils.py @@ -25,6 +25,7 @@ from ironic.objects import conductor from ironic.objects import node from ironic.objects import port from ironic.objects import portgroup +from ironic.objects import trait from ironic.objects import volume_connector from ironic.objects import volume_target @@ -508,9 +509,7 @@ def get_test_xclarity_driver_info(): def get_test_node_trait(**kw): return { - # TODO(mgoddard): Replace None below with the NodeTrait RPC object - # VERSION when the RPC object is added. - 'version': kw.get('version', None), + 'version': kw.get('version', trait.Trait.VERSION), "trait": kw.get("trait", "trait1"), "node_id": kw.get("node_id", "123"), 'created_at': kw.get('created_at'), |