Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report XML errors while reading an AY configuration file #450

Merged
merged 3 commits into from Aug 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions package/autoyast2.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Aug 14 09:47:25 CEST 2018 - schubi@suse.de

- AY configuration module: Report XML errors while reading an
AY configuration file (bsc#1098794)
- 4.0.58

-------------------------------------------------------------------
Thu Jun 28 14:29:25 CEST 2018 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/autoyast2.spec
Expand Up @@ -22,7 +22,7 @@
%endif

Name: autoyast2
Version: 4.0.57
Version: 4.0.58
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
9 changes: 6 additions & 3 deletions src/modules/Profile.rb
Expand Up @@ -7,6 +7,7 @@
#
# $Id$
require "yast"
require "yast2/popup"

module Yast
class ProfileClass < Module
Expand Down Expand Up @@ -745,15 +746,17 @@ def ReadXML(file)
@current = XML.XMLToYCPFile(file)
end

if @current != {} && Builtins.size(@current) == 0
xml_error = XML.XMLError
if xml_error && !xml_error.empty?
# autoyast has read the autoyast configuration file but something went wrong
message = _(
"The XML parser reported an error while parsing the autoyast profile. The error message is:\n"
)
message = Ops.add(message, XML.XMLError)
Popup.Error(message)
message += xml_error
Yast2::Popup.show(message, headline: :error)
return false
end

Import(@current)
true
end
Expand Down