-
Notifications
You must be signed in to change notification settings - Fork 295
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
Error in zabbix_action #92
Comments
I think the problem is around the computation of the difference as it always gets this difference:
|
Value of existing_action in check_difference:
Value of kwargs in check_difference
So the difference fields are empty in kwargs because the come through the function call. The solution should be to drop them if they are empty && missing in the current action too? |
If I add a def compare_dictionaries(d1, d2, diff_dict):
...
for k, v in d1.items():
if k not in d2:
if v == "":
continue
diff_dict[k] = v
continue
if isinstance(v, dict):
diff_dict[k] = {}
... WDYT? |
You have got it right @rockaut . I've noticed before that Zabbix developers deprecated these six API parameters without stating it in the API changes ( The fix itself should deprecate all of the mentioned parameters for Zbx 5.0+ and clearly state that in the module documentation. That means those 6 parameters should not be allowed to propagate so further in the code and should be terminated in the I am worried that adding Are you interested in contributing this by yourself @rockaut? If not, I can try to come up with a fix later this week. Of course providing that @sky-joker haven't started working on this already :) |
Shure I would help out here - we transitioned to 5.0.1 and I'm having more in the hands coming in the next weeks. Just to get that right: B. I am also worried by the That said, if A is true then B is obsolete anyways? |
I checked it in the docs: https://www.zabbix.com/documentation/4.4/manual/api/reference/action/object Those 6 fields are removed. Gnn... As much as I like Zabbix, their API documentation is Changed.md is bad. |
:D https://support.zabbix.com/browse/ZBX-17932 I'm already changing the if-thing to your suggested way in my workaround implementation. I will file the PR tomorrow. |
This one didn't help either :) Yes, A is right, those 6 parameters are not needed anymore. That means:
|
Maybe better example here:
|
I haven't seen your example before I pushed the PR but I had a look into it. The mediatypes module has another layout/does things a little bit different than the action module. I more or less have done it just the action modules way as I otherwise would have to introduce some more changes and making the module structure inconsistent - refactoring should be a whole other process. Hope that's good anyways? If you wish I will change it to LooseVersion tomorrow. |
I haven't realized that my patch haven't made it through yet. What you did is completely fine. Thanks for the patch! It is true that all of the modules could use some unification and refactoring |
@D3DeFi Hm, how would you start that. I would like to help here out. |
Good question. I am starting to feel bad for always replaying with I don't know yet 😆 These modules were mostly on life support with bugfixes when we were part of ansible/ansible. Now that roles are part of this repo and we are gaining some traction, lots of similar questions need to be answered. I tried to think a bit about where to direct the repository, but time is a concern so my work mostly consists of fixing bugs rn and porting to 5.0. And boy is it pain when each module is different. If you want or have some ideas you can always hit me up on d3defi@gmail.com
It would. We don't have that much people and time to actually start something major so this ad-hoc approach is more preferred for now. But some implementations are better discussed in advance (issue, mail, or we can always try to organize IRC meeting). I have in a personal TODO (more like, stuff I'd like to do, somewhere in my head) to check if we can benefit from common class (something like |
SUMMARY
Error on zabbix_action if there's no change.
ISSUE TYPE
COMPONENT NAME
zabbix_action
ANSIBLE VERSION
ENVIRONMENT
Zabbix 5.0.1 (centos containers)
STEPS TO REPRODUCE
Running the play the first time creates the action. Subsequent runs are failing.
EXPECTED RESULTS
Subsequent runs shouldn't fail.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: