Skip to content

Commit

Permalink
Merge 527bfcc into 287cb16
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed May 7, 2020
2 parents 287cb16 + 527bfcc commit 768c4c0
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
6 changes: 6 additions & 0 deletions package/yast2-firewall.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 7 15:22:56 CEST 2020 - schubi@suse.de

- AutoYaST: Cleanup/improve issue handling (bsc#1171335).
- 4.2.5

-------------------------------------------------------------------
Sat Mar 21 12:02:05 UTC 2020 - Knut Anderssen <kanderssen@suse.com>

Expand Down
10 changes: 5 additions & 5 deletions package/yast2-firewall.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-firewall
Version: 4.2.4
Version: 4.2.5
Release: 0
Summary: YaST2 - Firewall Configuration
Group: System/YaST
Expand All @@ -28,13 +28,13 @@ Source0: %{name}-%{version}.tar.bz2

BuildRequires: perl-XML-Writer update-desktop-files yast2-testsuite
BuildRequires: yast2-devtools >= 4.2.2
# Removed zone name from common attributes definition
BuildRequires: yast2 >= 4.1.67
# AutoYaST issue report
BuildRequires: yast2 >= 4.2.84
BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake)
BuildRequires: rubygem(%rb_default_ruby_abi:rspec)

# Removed zone name from common attributes definition
Requires: yast2 >= 4.1.67
# AutoYaST issue report
Requires: yast2 >= 4.2.84
Requires: yast2-ruby-bindings >= 1.0.0

# ButtonBox widget
Expand Down
38 changes: 38 additions & 0 deletions src/lib/y2firewall/autoinst_profile/firewall_section.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) [2020] SUSE LLC
#
# All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU General Public License as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, contact SUSE LLC.
#
# To contact SUSE LLC about this file by physical or electronic mail, you may
# find current contact information at www.suse.com.

require "installation/autoinst_profile/section_with_attributes"

module Y2Firewall
module AutoinstProfile
# This class represents an AutoYaST <firewall> section
#
class FirewallSection < ::Installation::AutoinstProfile::SectionWithAttributes
# Creates an instance based on the profile representation used by the AutoYaST modules
# (hash with nested hashes and arrays).
#
# @param hash [Hash] Firewall section from an AutoYaST profile
# @return [FirewallSection]
def self.new_from_hashes(_hash)
result = new
result
end
end
end
end
7 changes: 6 additions & 1 deletion src/lib/y2firewall/clients/auto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
require "y2firewall/proposal_settings"
require "y2firewall/summary_presenter"
require "y2firewall/dialogs/main"
require "y2firewall/autoinst_profile/firewall_section"
require "installation/auto_client"

Yast.import "Mode"
Expand Down Expand Up @@ -200,7 +201,11 @@ def check_profile_for_errors
all_interfaces = zones.flat_map { |zone| zone["interfaces"] || [] }
double_entries = all_interfaces.select { |i| all_interfaces.count(i) > 1 }.uniq
unless double_entries.empty?
AutoInstall.issues_list.add(:invalid_value, "firewall", "interfaces",
AutoInstall.issues_list.add(:ay_invalid_value,
Y2Firewall::AutoinstProfile::FirewallSection.new_from_hashes(
self.class.profile
),
"interfaces",
double_entries.join(","),
_("This interface has been defined for more than one zone."))
end
Expand Down

0 comments on commit 768c4c0

Please sign in to comment.