-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More fixes to zabbix_action.py #667
Conversation
…e must not be provided.
…n Ansible job report wqwork properly.
I don't understand why tests expect changed to be true when creating the same action again. |
Thank you for taking initiative in solving this @BGmot ! The problem with tests is that they usually run the first time and if they fail, ansible re-runs them with Your problem happens much sooner in the failed test log (around line ~70 in the first one (4.0@stable-2.10_py.27):
So what happens is that test wants to re-run same task again and expect nothing to be changed. Based on your PR it is possible that we expect wrong behavior to be correct in the tests and they should be changed. tl;dr something in the patch breaks idempotency of the module (for at least older zabbix versions) |
This is exactly what I am saying. After fixing the issue with "value" attribute and running real-life tests with creating, updating and creating an Action with exactly the same parameters as existing one I noticed that in the latter case it always shows 'changed=ture' instead of expected 'changed=false' as no parameters changed. After some digging I found during current and new objects comparison for some reason we discard "recovery_operations" and "acknowledge_operations" so I fixed that in |
…sions prior to 6.0.
Codecov Report
@@ Coverage Diff @@
## main #667 +/- ##
==========================================
- Coverage 70.98% 70.65% -0.34%
==========================================
Files 27 27
Lines 3550 3568 +18
Branches 920 929 +9
==========================================
+ Hits 2520 2521 +1
- Misses 751 765 +14
- Partials 279 282 +3
Continue to review full report at Codecov.
|
Ok, I've fixed changed=false/true for older versions of Zabbix. Apparently action.get in Zabbix 5.0 returns recoveryOperations and acknowledgeOperations properties while in Zabbix 6.0 it returns recovery_operations and acknowledge_operations. PS: in our tests matrix we don't have Zabbix 6.0, should we add one? |
Dont worry about codecov, those are tests that fail if coverage of our tests is lower than before PR contribution. I seem to never satisfy that check either :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now looks good to me. Thank you for taking time to contribute this patch. Very nice job! 🚀
SUMMARY
Fixes #661
Fixes action module behaviour: always showing changed=True even if nothing has changed
ISSUE TYPE
COMPONENT NAME
zabbix_action.py