Skip to content

Commit 7565dc4

Browse files
committed
refactor: Add backend abstration to firewall_lib
Introduce a backend class into firewall_lib, and move all `FirewallClient` operations into it. This gets rid of some global variables, separates the Ansible/parameter parsing from the firewalld operations, shrinks the massive main() function, and allows us to add another implementation for offline mode in the future (based on `firewalld-offline-cmd` or XML editing). This does not change the logic or code much, other than adding a truckload of `self.` prefixes and some `black` reformatting. There is still way too much global state, which makes the code hard to understand, but let's clean this up in steps. The only other changes aside from moving are the elimination of `handle_interface_permanent()` and `set_the_default_zone()` global functions. They are FirewallClient API specific, only get called once (the former with two unused parameters), and are simple enough to just get inlined.
1 parent 5b1b3e6 commit 7565dc4

File tree

1 file changed

+680
-587
lines changed

1 file changed

+680
-587
lines changed

0 commit comments

Comments
 (0)