Skip to content

Commit

Permalink
firewall.core.fw_ifcfg: iFix ifcfg_set_zone_of_interface for missing …
Browse files Browse the repository at this point in the history
…ZONE line
  • Loading branch information
t-woerner committed May 30, 2016
1 parent 9716683 commit 46ff47c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/firewall/core/fw_ifcfg.py
Expand Up @@ -60,8 +60,12 @@ def ifcfg_set_zone_of_interface(zone, interface):
"""Set zone (ZONE=<zone>) in the ifcfg file that uses the interface
(DEVICE=<interface>)"""

if zone == None:
zone = ""

ifcfg_file = search_ifcfg_of_interface(interface)
if ifcfg_file is not None and ifcfg_file.get("ZONE") != zone:
if ifcfg_file is not None and ifcfg_file.get("ZONE") != zone and not \
(ifcfg_file.get("ZONE") is None and zone == ""):
log.debug1("Setting ZONE=%s in '%s'" % (zone, ifcfg_file.filename))
ifcfg_file.set("ZONE", zone)
ifcfg_file.write()

0 comments on commit 46ff47c

Please sign in to comment.