Fix azure_rm_manageddisk caching comparison #624
Merged
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.
SUMMARY
Fix faulty comparison in is_attach_caching_option_different which returned True when caching was "None", and caused disks to be detached / reattached by mistake.
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION
The following code displays the issue. It runs the same action twice, but the result will show as "changed" for both.
This is because the
attach_caching
is None, but the comparison in the module is incorrect, leading the module to believe it needs to update the caching parameter.As a result, the disk gets detached from the VM and reattached, which could have unexpected consequences and possibly lead to issues.
The proposed patch fixes it, and the second run shows as unchanged, respecting indempotency.
Cheers!