Skip to content

Commit

Permalink
Changes based on CR.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Nov 24, 2017
1 parent c4c67a6 commit def209e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/include/network/lan/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1603,10 +1603,14 @@ def initial_hostname(ipaddr)
String.FirstChunk(Ops.get(host_list, 0, ""), " \t")
end

# Return a list of items for ComboBox with all the known firewalld zones
# and also an empty string option for the default zone.
#
# @return [Array <Array <String, String>>] list of names an description of
# known zones
def firewall_zones
@firewalld ||= Y2Firewall::Firewalld.instance
zones = [["", _("Automatically Assigned Zone")]]
if @firewalld.installed?
if firewalld.installed?
Y2Firewall::Firewalld::Zone.known_zones.map do |name, full_name|
zones << [name, full_name]
end
Expand All @@ -1616,5 +1620,12 @@ def firewall_zones

zones
end

# Convenience method which returns an instance of Y2Firewall::Firewalld
#
# @return [Y2Firewall::Firewalld] instance
def firewalld
@firewalld ||= Y2Firewall::Firewalld.instance
end
end
end

0 comments on commit def209e

Please sign in to comment.