From 70ea6837c0841e28f97a3263ff957b4c99104af5 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Tue, 5 May 2020 10:29:02 +0200 Subject: [PATCH 1/6] cleanup issue handling --- .../autoinst_profile/firewall_section.rb | 39 +++++++++++++++++++ src/lib/y2firewall/clients/auto.rb | 6 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 src/lib/y2firewall/autoinst_profile/firewall_section.rb diff --git a/src/lib/y2firewall/autoinst_profile/firewall_section.rb b/src/lib/y2firewall/autoinst_profile/firewall_section.rb new file mode 100644 index 00000000..6d0d9273 --- /dev/null +++ b/src/lib/y2firewall/autoinst_profile/firewall_section.rb @@ -0,0 +1,39 @@ +# 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 \ 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 diff --git a/src/lib/y2firewall/clients/auto.rb b/src/lib/y2firewall/clients/auto.rb index 54adab4b..9ff68af9 100644 --- a/src/lib/y2firewall/clients/auto.rb +++ b/src/lib/y2firewall/clients/auto.rb @@ -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" @@ -200,7 +201,10 @@ 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 From 0f6c5b88d9c67e2078050376a20e6a84b7e0dbe3 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 7 May 2020 14:47:12 +0200 Subject: [PATCH 2/6] rubocop --- src/lib/y2firewall/autoinst_profile/firewall_section.rb | 3 +-- src/lib/y2firewall/clients/auto.rb | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/y2firewall/autoinst_profile/firewall_section.rb b/src/lib/y2firewall/autoinst_profile/firewall_section.rb index 6d0d9273..6643e49e 100644 --- a/src/lib/y2firewall/autoinst_profile/firewall_section.rb +++ b/src/lib/y2firewall/autoinst_profile/firewall_section.rb @@ -24,13 +24,12 @@ module AutoinstProfile # This class represents an AutoYaST \ 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) + def self.new_from_hashes(_hash) result = new result end diff --git a/src/lib/y2firewall/clients/auto.rb b/src/lib/y2firewall/clients/auto.rb index 9ff68af9..98f64a85 100644 --- a/src/lib/y2firewall/clients/auto.rb +++ b/src/lib/y2firewall/clients/auto.rb @@ -203,7 +203,8 @@ def check_profile_for_errors unless double_entries.empty? AutoInstall.issues_list.add(:ay_invalid_value, Y2Firewall::AutoinstProfile::FirewallSection.new_from_hashes( - self.class.profile), + self.class.profile + ), "interfaces", double_entries.join(","), _("This interface has been defined for more than one zone.")) From 2e4efb82b7396cb78bba71bae28a4ae444a6bd1b Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 7 May 2020 15:07:35 +0200 Subject: [PATCH 3/6] comments --- src/lib/y2firewall/autoinst_profile/firewall_section.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/y2firewall/autoinst_profile/firewall_section.rb b/src/lib/y2firewall/autoinst_profile/firewall_section.rb index 6643e49e..1c5bab44 100644 --- a/src/lib/y2firewall/autoinst_profile/firewall_section.rb +++ b/src/lib/y2firewall/autoinst_profile/firewall_section.rb @@ -22,7 +22,7 @@ module Y2Firewall module AutoinstProfile # This class represents an AutoYaST \ 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). From 189cd2e16a0242c509de24e41c481bab7b19a25e Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 7 May 2020 15:08:26 +0200 Subject: [PATCH 4/6] comments --- src/lib/y2firewall/autoinst_profile/firewall_section.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/y2firewall/autoinst_profile/firewall_section.rb b/src/lib/y2firewall/autoinst_profile/firewall_section.rb index 1c5bab44..22f2a99c 100644 --- a/src/lib/y2firewall/autoinst_profile/firewall_section.rb +++ b/src/lib/y2firewall/autoinst_profile/firewall_section.rb @@ -21,7 +21,7 @@ module Y2Firewall module AutoinstProfile - # This class represents an AutoYaST \ section + # This class represents an AutoYaST section # class FirewallSection < ::Installation::AutoinstProfile::SectionWithAttributes # Creates an instance based on the profile representation used by the AutoYaST modules From 79811b905e552328b4598650e8eea2197fff34f0 Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 7 May 2020 15:11:55 +0200 Subject: [PATCH 5/6] adapted requirments --- package/yast2-firewall.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/yast2-firewall.spec b/package/yast2-firewall.spec index cc7a12d1..8069a041 100644 --- a/package/yast2-firewall.spec +++ b/package/yast2-firewall.spec @@ -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 From 527bfccf8b3f205c1345a5eafd2df99ed53ae11e Mon Sep 17 00:00:00 2001 From: Stefan Schubert Date: Thu, 7 May 2020 15:25:18 +0200 Subject: [PATCH 6/6] versioning --- package/yast2-firewall.changes | 6 ++++++ package/yast2-firewall.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package/yast2-firewall.changes b/package/yast2-firewall.changes index 3b50f86e..be43a66b 100644 --- a/package/yast2-firewall.changes +++ b/package/yast2-firewall.changes @@ -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 diff --git a/package/yast2-firewall.spec b/package/yast2-firewall.spec index 8069a041..db5a5773 100644 --- a/package/yast2-firewall.spec +++ b/package/yast2-firewall.spec @@ -17,7 +17,7 @@ Name: yast2-firewall -Version: 4.2.4 +Version: 4.2.5 Release: 0 Summary: YaST2 - Firewall Configuration Group: System/YaST