Skip to content

Commit

Permalink
Fix firewalld zones reader
Browse files Browse the repository at this point in the history
Adapted the zones reader to the new --list-all-zones output introduced
by firewalld 2.0.1 version (bsc#1216534)
  • Loading branch information
teclator committed Oct 25, 2023
1 parent b3a2165 commit 4e35fde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions library/network/src/lib/y2firewall/firewalld/zone_reader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ def parse_zones
end

def current_zone_from(line)
attribute, _value = line.split(/\s*\(active\)\s*$/)
zone_names.include?(attribute) ? attribute : nil
name, *_status = line.split
zone_names.include?(name) ? name : nil
end

ATTRIBUTE_MAPPING = { "summary" => "short" }.freeze
Expand Down
8 changes: 4 additions & 4 deletions library/network/test/y2firewall/firewalld/zone_reader_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
" rich rules: ",
"\t",
"",
"public (active)",
"public (default, active)",
" summary: Public",
" description: For use in public areas. You do not trust the other" \
" computers on networks to not harm your computer." \
" Only selected incoming connections are accepted.",
" description: For use in public areas. You do not trust the other " \
"computers on networks to not harm your computer. " \
"Only selected incoming connections are accepted.",
" target: default",
" icmp-block-inversion: no",
" interfaces: eth0 ens3",
Expand Down

0 comments on commit 4e35fde

Please sign in to comment.