added a source/network add/remove to/from zone for firewalld - removed useless comment

This commit is contained in:
Timothy Vandenbrande 2014-11-21 15:39:07 +01:00
parent 6fab8f49a9
commit b365fc4464

View file

@ -154,13 +154,11 @@ def add_source(zone, source):
fw_zone = fw.config().getZoneByName(zone) fw_zone = fw.config().getZoneByName(zone)
fw_settings = fw_zone.getSettings() fw_settings = fw_zone.getSettings()
fw_settings.addSource(source) fw_settings.addSource(source)
fw_zone.update(fw_settings)
def remove_source(zone, source): def remove_source(zone, source):
fw_zone = fw.config().getZoneByName(zone) fw_zone = fw.config().getZoneByName(zone)
fw_settings = fw_zone.getSettings() fw_settings = fw_zone.getSettings()
fw_settings.removeSource(source) fw_settings.removeSource(source)
fw_zone.update(fw_settings)
#################### ####################
# service handling # service handling
@ -354,7 +352,6 @@ def main():
msgs.append("Added %s to zone %s" % (source, zone)) msgs.append("Added %s to zone %s" % (source, zone))
elif desired_state == "disabled": elif desired_state == "disabled":
if is_enabled == True: if is_enabled == True:
msgs.append("source is present")
if module.check_mode: if module.check_mode:
module.exit_json(changed=True) module.exit_json(changed=True)