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
Add storage checks #468
Add storage checks #468
Changes from 15 commits
d718825
4ff3880
c124544
1e121ab
7c55909
4de0d87
712a787
c8c2777
4a6f582
87b8938
1b9222d
fb197cd
26e3465
690ff06
53f5af4
6425d89
c7133b7
645f734
f149102
d716a7e
6f23a5e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
------------------------------------------------------------------- | ||
Mon Jan 15 14:22:32 UTC 2018 - jlopez@suse.com | ||
|
||
- Added sanity checks for partitioning setup. | ||
- Partitioner: setup issues are shown to the user before continue. | ||
Mandatory product volumes are required according to control file. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I miss the storage-ng fate entry and also mentioning the several bug reports we have about the missing checks. |
||
- 4.0.70 | ||
|
||
------------------------------------------------------------------- | ||
Mon Jan 15 12:51:01 UTC 2018 - ancor@suse.com | ||
|
||
|
@@ -6,6 +14,7 @@ Mon Jan 15 12:51:01 UTC 2018 - ancor@suse.com | |
alignment types, in addition to the optimal one. | ||
- Added a (temporary) workaround to a possible bug in libstorage-ng | ||
regarding alignment. | ||
- 4.0.69 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was not intended to introduce a version bump, no need to "correct" that |
||
|
||
------------------------------------------------------------------- | ||
Tue Jan 9 15:36:15 UTC 2018 - lslezak@suse.cz | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
# | ||
|
||
Name: yast2-storage-ng | ||
Version: 4.0.68 | ||
Version: 4.0.70 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you jumping two numbers here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Arfff |
||
Release: 0 | ||
BuildArch: noarch | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# encoding: utf-8 | ||
|
||
# Copyright (c) [2017] 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 "yast" | ||
require "yast/i18n" | ||
require "y2storage" | ||
|
||
Yast.import "HTML" | ||
|
||
module Y2Partitioner | ||
# Class to represent storage setup errors | ||
class SetupErrorsPresenter | ||
include Yast::I18n | ||
|
||
# Constructor | ||
# | ||
# @param setup_checker [SetupChecker] | ||
def initialize(setup_checker) | ||
textdomain "storage" | ||
@setup_checker = setup_checker | ||
end | ||
|
||
# HTML represetation of the storage setup errors | ||
# | ||
# @note An empty string is returned when there is no error. | ||
# | ||
# @return [String] | ||
def to_html | ||
errors = [boot_errors_html, product_errors_html].compact | ||
return "" if errors.empty? | ||
|
||
errors.join(Yast::HTML.Newline) | ||
end | ||
|
||
private | ||
|
||
# @return [SetupChecker] checker for the current setup | ||
attr_reader :setup_checker | ||
|
||
# HTML representation for boot errors | ||
# | ||
# @return [String, nil] nil if there is no boot error | ||
def boot_errors_html | ||
errors = setup_checker.boot_errors | ||
# TRANSLATORS | ||
header = _("The system might not be able to boot:\n") | ||
|
||
errors_html(header, errors) | ||
end | ||
|
||
# HTML representation for mandatory product errors | ||
# | ||
# @return [String, nil] nil if there is no product error | ||
def product_errors_html | ||
errors = setup_checker.product_errors | ||
# TRANSLATORS | ||
header = _("The system could not work properly because the following errors were found:\n") | ||
|
||
errors_html(header, errors) | ||
end | ||
|
||
# HTML representation for a set of errors | ||
# | ||
# @note The representation is composed by a header message and the list error messages. | ||
# | ||
# @param header [String] header text | ||
# @param errors [Array<SetupError>] list of errors | ||
# | ||
# @return [String, nil] nil if there is no error | ||
def errors_html(header, errors) | ||
return nil if errors.empty? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't be better to return an empty string? If you keep the current behavior, please document that this method and the two methods relying on it can return nil There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, probably it is better to always return a valid html representation, even when there is no error. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean for the |
||
|
||
error_messages = errors.map(&:message) | ||
header + Yast::HTML.Newline + Yast::HTML.List(error_messages) | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NP: I would mention the expert partitioner here (and maybe also the new control.xml format somehow).