community.zabbix
community.zabbix copied to clipboard
Maintenance Module Not Idempotent
SUMMARY
@BGmot and @eb4x I'm curious at your thoughts. I was looking at why the integration tests for #1564 kept failing on the maintenance module even though the PR doesn't touch it. When you look at line 270 of the integration test, we have an existing note about false failures.
When I look at the module itself it ultimately points back to lines 456-458. Because we don't force the user to create set an active_since value, when there is no value in the module request itself, we set it to now(). The problem is that if you rerun the module, there is still no time there so it updates it to the current now() and if you have rolled pass the minute barrier, it changes.
I would argue the best way to do this is to first see if there is an existing maintenance event, and if there is and active_since isn't explicitly set in the module, to not update or the end time. But that also changes the current behavior not really in a breaking way, but still changes it. Thoughts?
ISSUE TYPE
- Bug Report
COMPONENT NAME
zabbix_maintenance