Skip to content
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

[2018.3] Fix to utils/ to honor max_event_size with nested dictionaries #50382


None yet
4 participants
Copy link

commented Nov 5, 2018

What does this PR do?

Adding _trim_dict_in_dict to utils/ to be called from trim_dict when data contains a nested dictionary. This will ensure that values will still be trimmed correctly.

What issues does this PR fix or reference?


Previous Behavior

Event data that contained nested dictionaries that exceeded the max_event_size would not be trimmed because the size of the key was reported, not the actual data inside the dictionary.

New Behavior

If a nested dictionary is found in the event data dictionary, the _trim_dict_in_dict is called recursively, ensuring all values are trimmed correctly.

Tests written?

Not yet.

Commits signed with GPG?


Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

Adding _trim_dict_in_dict to utils/ to be called from trim_…
…dict when data contains a nested dictionary. This will ensure that values will still be trimmed correctly.

@garethgreenaway garethgreenaway requested review from cachedout and whytewolf Nov 5, 2018

Copy link

left a comment

This change works well. I noticed no reduction in performance.

And enough of the data is saved that it doesn't compromise the return results.


This comment has been minimized.

Copy link
Member Author

commented Nov 5, 2018

@whytewolf Thanks! I want to include a simple test just to make everything works as expected.

garethgreenaway added some commits Nov 5, 2018

@rallytime rallytime merged commit ed4fa87 into saltstack:2018.3 Nov 5, 2018

7 of 10 checks passed

continuous-integration/jenkins/pr-merge This commit cannot be built
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has failed
jenkins/pr/py3-windows-2016 running py3-windows-2016...
WIP Ready for review
jenkins/pr/docs The docs job has passed
jenkins/pr/lint The lint job has passed
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.