Skip to content

Commit

Permalink
improvement(zone): Update error message
Browse files Browse the repository at this point in the history
Add zone name to the ZONE_CONLICT error message

Signed-off-by: Arko Dasgupta <[email protected]>
  • Loading branch information
Arko Dasgupta authored and erig0 committed Dec 21, 2020
1 parent 526deb5 commit d7dfce0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/firewall/core/fw_zone.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,11 @@ def add_interface(self, zone, interface, sender=None,
raise FirewallError(errors.ZONE_ALREADY_SET,
"'%s' already bound to '%s'" % (interface,
zone))
if self.get_zone_of_interface(interface) is not None:
zoi = self.get_zone_of_interface(interface)
if zoi is not None:
raise FirewallError(errors.ZONE_CONFLICT,
"'%s' already bound to a zone" % interface)
"'%s' already bound to '%s'" % (interface,
zoi))

log.debug1("Setting zone of interface '%s' to '%s'" % (interface,
_zone))
Expand Down

0 comments on commit d7dfce0

Please sign in to comment.