[PR #4524/8e72e98a backport][stable-4] Implement contructable support for opennebula inventory plugin: keyed… #4549
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #4524 as merged into main (8e72e98).
…_groups, compose, groups
SUMMARY
#4497 noted that the opennebula inventory plugin inherits
Constructable
, and the doc string also includes the macro(?) for that, however the code does not implement the standard dynamic inventory features such as keyed_groups, etc. This PR aims to implement that functionality.I have included a new unit test, as well as new test-fixture data and re-worked some of the helper logic in the tests. Hopefully @feldsam is ok with the changes. I would be happy to refactor the pre-existing test and move the pre-existing sample data to the external file to make it match what I did.
Note, the PR is incomplete as not all of the testing logic passes, see below.
Fixes #4497
ISSUE TYPE
COMPONENT NAME
opennebula inventory plugin
ADDITIONAL INFORMATION
The code currently produces the output I would expect, however the unit test I added fails due to a traceback. I looked briefly into this, but wasn't quite sure why it was failing. The two
test_
functions I added are identical except that one of them has commented out portions that are currently failing here: