Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Optimize firewalld state #49811
What does this PR do?
This PR removes refactors the firewalld.present state function such that it only calls firewalld execution module functions when necessary. This significantly improves the firewalld.present state function performance.
What issues does this PR fix or reference?
Previously, the firewalld.present state function called many firewalld execution module functions even if the calls were unnecessary based on the sls file being processed.
Only call firewalld execution module functions if necessary based on the sls file being processed.
No - functionality should not have changed. Existing tests should suffice.
Commits signed with GPG?
At a glance, the changes look good. The indentation fixes are of course a good idea. The functionality also looks good, it should speed up execution significantly when pruning of existing settings is switched off.
I added some inline comments for things I noticed.
Apart from that, I cannot really tell, because I have no way to test the changes at the moment.
@hakoerber I apologize if I'm missing something obvious, but I can't seem to find your comments. If you've identified more opportunities for improvement, I'd be happy to incorporate your suggestions.
FWIW, I tested by setting