diff --git a/package/yast2-migration.changes b/package/yast2-migration.changes index de8bf42..757530d 100644 --- a/package/yast2-migration.changes +++ b/package/yast2-migration.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Oct 6 06:58:08 UTC 2015 - lslezak@suse.cz + +- display a hint to manually rollback the system when migration + fails or is aborted during package installation (FATE#315161) + ------------------------------------------------------------------- Thu Sep 24 19:12:38 UTC 2015 - lslezak@suse.cz diff --git a/src/clients/migration_proposals.rb b/src/clients/migration_proposals.rb index cb138b5..2db1dc1 100644 --- a/src/clients/migration_proposals.rb +++ b/src/clients/migration_proposals.rb @@ -32,4 +32,4 @@ Yast::Wizard.CloseDialog end -ret +return ret diff --git a/src/lib/migration/main_workflow.rb b/src/lib/migration/main_workflow.rb index c9de418..b04cd42 100644 --- a/src/lib/migration/main_workflow.rb +++ b/src/lib/migration/main_workflow.rb @@ -202,9 +202,25 @@ def perform_migration # this client is located in the yast2-packager package ret = Yast::WFM.CallFunction("inst_rpmcopy") log.info "inst_rpmcopy result: #{ret.inspect}" + + display_abort_message if ret == :abort || ret == :cancel + ret end + def display_abort_message + Yast::Report.Error( + # TRANSLATORS: an error message, the migration to a new service pack failed + # or was aborted, the partly migrated system should be restored from + # a snapshot or backup + _("The migration to the new service pack has failed. The system is most\n" \ + "likely in an inconsistent state.\n" \ + "\n" \ + "We strongly recommend to rollback to a snapshot created before the\n" \ + "migration was started (via selecting the snapshot in the boot menu\n" \ + "if you use snapper) or restore the system from a backup.")) + end + def create_pre_snapshot if snapper_configured? self.pre_snapshot = perform_snapshot(:pre, "before online migration") diff --git a/test/main_workflow_test.rb b/test/main_workflow_test.rb index 415f93e..2f37318 100644 --- a/test/main_workflow_test.rb +++ b/test/main_workflow_test.rb @@ -83,6 +83,7 @@ def mock_client(name, res) it "aborts without rollback when the package installation is aborted" do mock_client("inst_rpmcopy", :abort) + expect(Yast::Report).to receive(:Error).with(/migration to the new service pack has failed/) expect(Yast::WFM).to_not receive(:CallFunction).with("registration_sync") expect(::Migration::MainWorkflow.run).to eq :abort