-
-
Save kellinm/18dc51a6c5b5fbc204965f68cea49e94 to your computer and use it in GitHub Desktop.
Naive FirewallD Ansible Module Patch proof of concept
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
221,225d220 | |
< from firewall.core.fw_nm import nm_is_imported, \ | |
< nm_set_zone_of_connection, \ | |
< nm_get_connection_of_interface, \ | |
< nm_get_zone_of_connection | |
< | |
464d458 | |
< nm_set_zone_of_connection(self.zone, interface) | |
505,513d498 | |
< if nm_is_imported(): | |
< try: | |
< connection = nm_get_connection_of_interface(interface) | |
< except Exception: | |
< pass | |
< else: | |
< if connection is not None: | |
< if self.zone != nm_get_zone_of_connection(connection): | |
< nm_set_zone_of_connection(self.zone, connection) | |
523,534d507 | |
< def try_set_zone_of_interface(_zone, interface): | |
< if nm_is_imported(): | |
< try: | |
< connection = nm_get_connection_of_interface(interface) | |
< except Exception: | |
< pass | |
< else: | |
< if connection is not None: | |
< if _zone != nm_get_zone_of_connection(connection): | |
< nm_set_zone_of_connection(_zone, connection) | |
< return True | |
< return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment