Skip to content

Commit

Permalink
make autoyast able to continue on commit errors (bnc#785234)
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Fehr committed Oct 16, 2012
1 parent d573e90 commit fa0c683
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
5 changes: 5 additions & 0 deletions package/yast2-storage.changes
@@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Oct 16 15:00:38 CEST 2012 - fehr@suse.de

- make autoyast able to continue on commit errors (bnc#785234)

-------------------------------------------------------------------
Fri Oct 12 16:55:53 CEST 2012 - aschnell@suse.de

Expand Down
47 changes: 29 additions & 18 deletions storage/src/modules/StorageClients.ycp
Expand Up @@ -31,6 +31,7 @@
module "StorageClients";

import "Label";
import "Mode";
import "Popup";
import "Report";
import "SlideShow";
Expand Down Expand Up @@ -105,38 +106,48 @@ global boolean YesNoPopup (string text)
}


global boolean CommitErrorPopup(integer error, string last_action, string extended_message)
global boolean CommitErrorPopup(integer error, string last_action, string extended_message)
{
y2milestone("CommitErrorPopup error:%1 last_action:%2 extended_message:%3",
error, last_action, extended_message);
y2milestone("CommitErrorPopup error:%1 last_action:%2 extended_message:%3",
error, last_action, extended_message);

list<string> tmp1 = splitstring(extended_message, "\n");
if (size(tmp1) > 5)
list<string> tmp1 = splitstring(extended_message, "\n");
if (size(tmp1) > 5)
{
tmp1 = sublist(tmp1, 0, 5);
tmp1 = tmp1 + "...";
tmp1 = sublist(tmp1, 0, 5);
tmp1 = tmp1 + "...";
}
extended_message = mergestring(tmp1, "\n");
extended_message = mergestring(tmp1, "\n");

string text = _("Failure occurred during the following action:") + "\n" + last_action + "\n\n";
string text = _("Failure occurred during the following action:") + "\n" + last_action + "\n\n";

string tmp = LibStorage::StorageInterface::getErrorString(sint, error);
if (!isempty(tmp))
string tmp = LibStorage::StorageInterface::getErrorString(sint, error);
if (!isempty(tmp))
{
text = text + tmp + "\n\n";
text = text + tmp + "\n\n";
}

text = text + sformat(_("System error code was: %1"), error) + "\n\n";
text = text + sformat(_("System error code was: %1"), error) + "\n\n";

if (!isempty(extended_message))
if (!isempty(extended_message))
{
text = text + extended_message + "\n\n";
text = text + extended_message + "\n\n";
}

text = text + _("Continue despite the error?");
text = text + _("Continue despite the error?");

return Report::ErrorAnyQuestion(Popup::NoHeadline(), text, Label::ContinueButton(),
Label::AbortButton(), `focus_no);
boolean ret = Report::ErrorAnyQuestion(Popup::NoHeadline(), text,
Label::ContinueButton(),
Label::AbortButton(), `focus_no);
if( Mode::autoinst() )
{
map ex = Report::Export();
if( ex["yesno_messages","show"]:true==false ||
ex["yesno_messages","timeout"]:0>0 )
ret = true;
}
y2milestone( "CommitErrorPopup ret:%1", ret );
return ret;
}


Expand Down

0 comments on commit fa0c683

Please sign in to comment.