This repository was archived by the owner on Jan 20, 2026. It is now read-only.
V3.2.1 Patch NSX-T Rest Python code to make it works (but not idempotent) with NSX-T when _revision is missing#461
Open
smesguich-orange wants to merge 1 commit into
Conversation
…ent) with NSX-T when _revision is missing Signed-off-by: Samuel MESGUICH <samuel.mesguich@orange.com>
salv-orlando
left a comment
There was a problem hiding this comment.
Thanks for this PR!
I reckon it might be important to identify which resources are not returning the _revision attribute to figure out if there are alternate way of identifying whether there was a change (e.g.: last_update_time, resource data hash, etc)
| self.module.exit_json(changed=False, body=after_resp) | ||
| else: | ||
| self.module.warn("_revision key in dict is missing") | ||
| self.module.warn("Count change but possibly nothing change. Cause : _revision key in dict is missing.") |
There was a problem hiding this comment.
The log statement at line 240 seems redundant.
This can probably be rephrased to something like "Defaulting to changed=True because resource %s does not have _revision attribute" % self._path
| if before_resp: | ||
| before_revision = "" | ||
|
|
||
| if before_resp and "_revision" in before_resp : |
There was a problem hiding this comment.
suggestion
if before_resp:
before_revision = before_resp.get('_revision', '')
This might simplify a little the logic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Hello
NSX-T Rest API module is not working for NSX-T under 3.2.
This is related to the
_revisionattribute of object in NSX-T which are not on every object.This modification let the module edit object without
_revisionattribute but display warning that idempotance is not guaranteed.Minor bugfix for NSX-T V3.2.0 module version but make its works on NSX-T under 3.2 version.
Tested on v3.1.3