Hello community, here is the log from the commit of package yast2-installation for openSUSE:Factory checked in at 2017-05-06 20:45:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old) and /work/SRC/openSUSE:Factory/.yast2-installation.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-installation" Sat May 6 20:45:52 2017 rev:385 rq:492868 version:3.2.38 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes 2017-04-12 17:09:54.308865305 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-installation.new/yast2-installation.changes 2017-05-06 20:45:53.994448614 +0200 @@ -1,0 +2,19 @@ +Wed Apr 26 15:03:33 UTC 2017 - igonzalezsosa@suse.com + +- Move CaaSP specific code to yast2-caasp package + (bsc#1036838) +- 3.2.38 + +------------------------------------------------------------------- +Wed Apr 26 09:52:01 UTC 2017 - gsouza@suse.com + +- bsc#1031840 + - changed CheckFreeSpaceNow to use LANG=en_US.UTF-8 + +------------------------------------------------------------------- +Thu Apr 20 14:00:08 UTC 2017 - igonzalezsosa@suse.com + +- Add a NTP Servers settings to the overview dialog + (FATE#323249) + +------------------------------------------------------------------- Old: ---- yast2-installation-3.2.37.tar.bz2 New: ---- yast2-installation-3.2.38.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-installation.spec ++++++ --- /var/tmp/diff_new_pack.b2f6du/_old 2017-05-06 20:45:54.982309258 +0200 +++ /var/tmp/diff_new_pack.b2f6du/_new 2017-05-06 20:45:54.994307566 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.2.37 +Version: 3.2.38 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-installation-3.2.37.tar.bz2 -> yast2-installation-3.2.38.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/package/yast2-installation.changes new/yast2-installation-3.2.38/package/yast2-installation.changes --- old/yast2-installation-3.2.37/package/yast2-installation.changes 2017-04-07 14:59:25.098466244 +0200 +++ new/yast2-installation-3.2.38/package/yast2-installation.changes 2017-05-04 15:58:44.317375667 +0200 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Wed Apr 26 15:03:33 UTC 2017 - igonzalezsosa@suse.com + +- Move CaaSP specific code to yast2-caasp package + (bsc#1036838) +- 3.2.38 + +------------------------------------------------------------------- +Wed Apr 26 09:52:01 UTC 2017 - gsouza@suse.com + +- bsc#1031840 + - changed CheckFreeSpaceNow to use LANG=en_US.UTF-8 + +------------------------------------------------------------------- +Thu Apr 20 14:00:08 UTC 2017 - igonzalezsosa@suse.com + +- Add a NTP Servers settings to the overview dialog + (FATE#323249) + +------------------------------------------------------------------- Wed Apr 5 11:31:12 CEST 2017 - jreidinger@suse.com - Use y2start script instead of y2base (bsc#1027181) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/package/yast2-installation.spec new/yast2-installation-3.2.38/package/yast2-installation.spec --- old/yast2-installation-3.2.37/package/yast2-installation.spec 2017-04-07 14:59:25.098466244 +0200 +++ new/yast2-installation-3.2.38/package/yast2-installation.spec 2017-05-04 15:58:44.317375667 +0200 @@ -17,7 +17,7 @@ Name: yast2-installation -Version: 3.2.37 +Version: 3.2.38 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/clients/inst_casp_overview.rb new/yast2-installation-3.2.38/src/clients/inst_casp_overview.rb --- old/yast2-installation-3.2.37/src/clients/inst_casp_overview.rb 2017-04-07 14:59:25.102466244 +0200 +++ new/yast2-installation-3.2.38/src/clients/inst_casp_overview.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -require "installation/clients/inst_casp_overview" -::Installation::InstCaspOverview.new.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/clients/inst_casp_overview.rb new/yast2-installation-3.2.38/src/lib/installation/clients/inst_casp_overview.rb --- old/yast2-installation-3.2.37/src/lib/installation/clients/inst_casp_overview.rb 2017-04-07 14:59:25.110466244 +0200 +++ new/yast2-installation-3.2.38/src/lib/installation/clients/inst_casp_overview.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,182 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 SUSE LLC -# -# -# 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. -# -# To contact SUSE about this file by physical or electronic mail, you may find -# current contact information at www.suse.com. -# ------------------------------------------------------------------------------ - -require "users/widgets" -require "y2country/widgets" -require "ui/widgets" -require "tune/widgets" -require "registration/widgets/registration_code" - -require "installation/widgets/overview" -require "installation/widgets/system_role" -require "installation/services" - -module Installation - # This library provides a simple dialog for setting - # - the password for the system administrator (root) - # - the keyboard layout - # This dialog does not write the password to the system, - # only stores it in UsersSimple module, - # to be written during inst_finish. - class InstCaspOverview - include Yast::Logger - include Yast::I18n - include Yast::UIShortcuts - - def run - Yast.import "UI" - Yast.import "Language" - Yast.import "Mode" - Yast.import "CWM" - Yast.import "Popup" - Yast.import "Pkg" - Yast.import "InstShowInfo" - - textdomain "installation" - - # Simplified work-flow do not contain language proposal, but have software one. - # So avoid false positive detection of language change - Yast::Pkg.SetPackageLocale(Yast::Language.language) - - # We do not need to create a wizard dialog in installation, but it's - # helpful when testing all manually on a running system - Yast::Wizard.CreateDialog if separate_wizard_needed? - - # show the Beta warning if it exists - Yast::InstShowInfo.show_info_txt(INFO_FILE) if File.exist?(INFO_FILE) - - ret = nil - loop do - ret = Yast::CWM.show( - content, - # Title for installation overview dialog - caption: _("Installation Overview"), - # Button label: start the installation - next_button: _("Install"), - # do not show abort and back button - abort_button: "", - back_button: "" - ) - - # Currently no other return value is expected, behavior can - # be unpredictable if something else is received - raise - # RuntimeError - raise "Unexpected return value" if ret != :next - - # do software proposal - d = Yast::WFM.CallFunction("software_proposal", - [ - "MakeProposal", - { "simple_mode" => true } - ]) - # report problems with sofware proposal - if [:blocker, :fatal].include?(d["warning_level"]) - # %s is a problem description - Yast::Popup.Error( - _("Software proposal failed. Cannot proceed with installation.\n%s") % d["warning"] - ) - # continue only if confirmed - elsif Yast::WFM.CallFunction("inst_doit", []) == :next - break - end - end - - add_casp_services - - Yast::Wizard.CloseDialog if separate_wizard_needed? - - ret - end - - private - - # location of the info.txt file (containing the Beta warning) - INFO_FILE = "/info.txt".freeze - - # Specific services that needs to be enabled on CAaSP see (FATE#321738) - # It is additional services to the ones defined for role. - # It is caasp only services and for generic approach systemd-presets should be used. - # In this case it is not used, due to some problems with cloud services. - CASP_SERVICES = ["sshd", "cloud-init-local", "cloud-init", "cloud-config", - "cloud-final", "issue-generator", "issue-add-ssh-keys"].freeze - def add_casp_services - ::Installation::Services.enabled.concat(CASP_SERVICES) - end - - def quadrant_layout(upper_left:, lower_left:, upper_right:, lower_right:) - HBox( - HWeight( - 6, - VBox( - VSpacing(2), - VWeight(5, upper_left), - VWeight(5, lower_left) - ) - ), - HSpacing(3), - HWeight( - 4, - VBox( - VSpacing(2), - VWeight(5, upper_right), - VWeight(5, lower_right) - ) - ) - ) - end - - # Returns a pair with UI widget-set for the dialog and widgets that can - # block installation - def content - controller_node = Installation::Widgets::ControllerNodePlace.new - - kdump_overview = Installation::Widgets::Overview.new(client: "kdump_proposal") - bootloader_overview = Installation::Widgets::Overview.new(client: "bootloader_proposal", redraw: [kdump_overview]) - - quadrant_layout( - upper_left: VBox( - ::Registration::Widgets::RegistrationCode.new, - ::Users::PasswordWidget.new(little_space: true), - # use english us as default keyboard layout - ::Y2Country::Widgets::KeyboardSelectionCombo.new("english-us") - ), - lower_left: VBox( - Installation::Widgets::SystemRole.new(controller_node), - controller_node, - Tune::Widgets::SystemInformation.new - ), - upper_right: VBox( - Installation::Widgets::Overview.new(client: "partitions_proposal", redraw: [bootloader_overview]), - bootloader_overview - ), - lower_right: VBox( - Installation::Widgets::Overview.new(client: "network_proposal"), - kdump_overview - ) - ) - end - - # Returns whether we need/ed to create new UI Wizard - def separate_wizard_needed? - Yast::Mode.normal - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/clients/switch_scr_finish.rb new/yast2-installation-3.2.38/src/lib/installation/clients/switch_scr_finish.rb --- old/yast2-installation-3.2.37/src/lib/installation/clients/switch_scr_finish.rb 2017-04-07 14:59:25.118466244 +0200 +++ new/yast2-installation-3.2.38/src/lib/installation/clients/switch_scr_finish.rb 2017-05-04 15:58:44.497375667 +0200 @@ -152,7 +152,7 @@ def CheckFreeSpaceNow ret_exec = Convert.to_map( - SCR.Execute(path(".target.bash_output"), "/bin/df -h") + SCR.Execute(path(".target.bash_output"), "LANG=en_US.UTF-8 /bin/df -h") ) if Ops.get_integer(ret_exec, "exit", -1) != 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/dialogs/desktop_roles.rb new/yast2-installation-3.2.38/src/lib/installation/dialogs/desktop_roles.rb --- old/yast2-installation-3.2.37/src/lib/installation/dialogs/desktop_roles.rb 2017-04-07 14:59:25.118466244 +0200 +++ new/yast2-installation-3.2.38/src/lib/installation/dialogs/desktop_roles.rb 2017-05-04 15:58:44.505375667 +0200 @@ -1,5 +1,5 @@ require "yast" -require "installation/widgets/system_role" +require "installation/widgets/system_roles_radio_buttons" require "installation/widgets/online_repos" require "cwm/widget" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/system_role_reader.rb new/yast2-installation-3.2.38/src/lib/installation/system_role_reader.rb --- old/yast2-installation-3.2.37/src/lib/installation/system_role_reader.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/src/lib/installation/system_role_reader.rb 2017-05-04 15:58:44.597375667 +0200 @@ -0,0 +1,64 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 SUSE LLC +# +# +# 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. +# +# To contact SUSE about this file by physical or electronic mail, you may find +# current contact information at www.suse.com. +# ------------------------------------------------------------------------------ +module Installation + module Widgets + # Common methods for system roles widgets + # + # @see Installation::Widgets::SystemRole + module SystemRoleReader + def default + ::Installation::SystemRole.default? ? ::Installation::SystemRole.ids.first : nil + end + + def init + self.value = ::Installation::SystemRole.current || default + end + + def label + Yast::ProductControl.GetTranslatedText("roles_caption") + end + + def items + ::Installation::SystemRole.all.map do |role| + [role.id, role.label] + end + end + + def help + Yast::ProductControl.GetTranslatedText("roles_help") + "\n\n" + roles_help_text + end + + def store + log.info "Applying system role '#{value}'" + role = ::Installation::SystemRole.select(value) + + role.overlay_features + role.adapt_services + end + + private + + def roles_help_text + ::Installation::SystemRole.all.map { |r| "#{r.label}\n\n#{r.description}" }.join("\n\n\n") + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/widgets/hiding_place.rb new/yast2-installation-3.2.38/src/lib/installation/widgets/hiding_place.rb --- old/yast2-installation-3.2.37/src/lib/installation/widgets/hiding_place.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/src/lib/installation/widgets/hiding_place.rb 2017-05-04 15:58:44.597375667 +0200 @@ -0,0 +1,66 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 SUSE LLC +# +# +# 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. +# +# To contact SUSE about this file by physical or electronic mail, you may find +# current contact information at www.suse.com. +# ------------------------------------------------------------------------------ + +require "yast" +require "installation/system_role" + +Yast.import "CWM" + +module Installation + module Widgets + # This class offers a placeholder that to hide/show a given widget + class HidingPlace < CWM::ReplacePoint + # Constructor + # + # @param main_widget [CWM::AbstractWidget] + def initialize(main_widget) + @main_widget = main_widget + @empty = CWM::Empty.new("no_#{main_widget.widget_id}_placeholder") + super(id: "#{main_widget.widget_id}_placeholder", widget: @empty) + end + + # Show the main widget + def show + replace(main_widget) + main_widget.value = @main_widget_value if @main_widget_value + end + + # Hide the main widget + def hide + @main_widget_value = main_widget.value + replace(empty) + end + + # Save the main widget value + def store + @main_widget_value = main_widget.value + super + end + + private + + # @return [CWM::AbstractWidget] main widget + attr_reader :main_widget + # @return [Empty] Empty widget placeholder + attr_reader :empty + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/widgets/overview.rb new/yast2-installation-3.2.38/src/lib/installation/widgets/overview.rb --- old/yast2-installation-3.2.37/src/lib/installation/widgets/overview.rb 2017-04-07 14:59:25.122466244 +0200 +++ new/yast2-installation-3.2.38/src/lib/installation/widgets/overview.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,139 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 SUSE LLC -# -# -# 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. -# -# To contact SUSE about this file by physical or electronic mail, you may find -# current contact information at www.suse.com. -# ------------------------------------------------------------------------------ - -require "yast" -require "cwm/widget" - -Yast.import "Popup" - -module Installation - module Widgets - # A widget for an all-in-one installation dialog. - # It uses the `simple_mode` of {Installation::ProposalClient#make_proposal} - # It is immutable, so for showing new values reinitialize widget - class Overview < CWM::CustomWidget - attr_reader :proposal_client - - # @param client [String] A proposal client implementing simple_mode, - # @param redraw [Array<Overview>] list of other Overview clients. In case - # of :redraw action every of these clients will be redrawn too. Caller is - # responsible for not creating circular dependencies. - # eg. "bootloader_proposal" - def initialize(client:, redraw: []) - textdomain "installation" - @proposal_client = client - @replace_point = "rp_" + client - # by default widget_id is the class name; must differentiate instances - self.widget_id = "overview_" + client - @blocking = false - @overviews_for_redraw = redraw - end - - def contents - ReplacePoint(Id(@replace_point), widget) - end - - def label - return @label if @label - - d = Yast::WFM.CallFunction(proposal_client, ["Description", {}]) - @label = d["menu_title"] - end - - def items - return @items if @items - - d = Yast::WFM.CallFunction(proposal_client, - [ - "MakeProposal", - { "simple_mode" => true } - ]) - if d["warning"] && !d["warning"].empty? && d["warning_level"] != :notice - Yast::Popup.LongError( - format( - _("Problem found when proposing %{client}:<br>" \ - "Severity: %{severity}<br>" \ - "Message: %{message}"), - client: label.delete("&"), - severity: (d["warning_level"] || :warning).to_s, - message: d["warning"] - ) - ) - @blocking = [:blocker, :fatal].include?(d["warning_level"]) - else - @blocking = false - end - @items = d["label_proposal"] - end - - # Updates overview content - def redraw - reset - - Yast::UI.ReplaceWidget(Id(@replace_point), widget) - - @overviews_for_redraw.each(&:redraw) - end - - # Custom event handler - def handle(_event) - Yast::WFM.CallFunction(proposal_client, ["AskUser", {}]) - - redraw - - nil - end - - def validate - return true unless @blocking - - # %s is a heading of a problematic section, like "Partitioning" or "Network" - Yast::Popup.Error( - _("%s blocks the installation. Please solve the problem there before proceeding.") % - label.delete("&") - ) - - false - end - - private - - def button_id - # an arbitrary unique id - "ask_" + proposal_client - end - - # The overview representation in common UI widgets - def widget - VBox( - Left(PushButton(Id(button_id), label)), - * items.map { |i| Left(Label(" * #{i}")) } - ) - end - - # Flush cache(s) - def reset - @label = nil - @items = nil - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/widgets/system_role.rb new/yast2-installation-3.2.38/src/lib/installation/widgets/system_role.rb --- old/yast2-installation-3.2.37/src/lib/installation/widgets/system_role.rb 2017-04-07 14:59:25.122466244 +0200 +++ new/yast2-installation-3.2.38/src/lib/installation/widgets/system_role.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,187 +0,0 @@ -# encoding: utf-8 - -# ------------------------------------------------------------------------------ -# Copyright (c) 2017 SUSE LLC -# -# -# 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. -# -# To contact SUSE about this file by physical or electronic mail, you may find -# current contact information at www.suse.com. -# ------------------------------------------------------------------------------ - -require "yast" -require "cwm/widget" -require "installation/services" -require "installation/custom_patterns" -require "installation/system_role" - -Yast.import "DefaultDesktop" -Yast.import "ProductControl" -Yast.import "IP" -Yast.import "Hostname" - -module Installation - module Widgets - # This widget is responsible of validate and store the introduced location - # which must be a valid IP or FQDN. - # bsc#1032057: old name: Controller Node, new name: Administration Node. - class ControllerNode < CWM::InputField - def label - # intentional no translation for CAASP - "Administration Node" - end - - # It stores the value of the input field if validates - # - # @see #validate - def store - role["controller_node"] = value - end - - # The input field is initialized with previous stored value - def init - self.value = role["controller_node"] - end - - # It returns true if the value is a valid IP or a valid FQDN, if not it - # displays a popup error. - # - # @return [Boolean] true if valid IP or FQDN - def validate - return true if Yast::IP.Check(value) || Yast::Hostname.CheckFQ(value) - - Yast::Popup.Error( - # TRANSLATORS: error message for invalid administration node location - _("Not valid location for the administration node, " \ - "please enter a valid IP or Hostname") - ) - - false - end - - private - - def role - ::Installation::SystemRole.find("worker_role") - end - end - - class ControllerNodePlace < CWM::ReplacePoint - def initialize - @controller_node = ControllerNode.new - @empty = CWM::Empty.new("no_controller") - super(widget: @empty) - end - - def show - replace(@controller_node) - end - - def hide - replace(@empty) - end - end - - module SystemRoleReader - def default - ::Installation::SystemRole.default? ? ::Installation::SystemRole.ids.first : nil - end - - def init - self.value = ::Installation::SystemRole.current || default - end - - def label - Yast::ProductControl.GetTranslatedText("roles_caption") - end - - def items - ::Installation::SystemRole.all.map do |role| - [role.id, role.label] - end - end - - def help - Yast::ProductControl.GetTranslatedText("roles_help") + "\n\n" + roles_help_text - end - - def store - log.info "Applying system role '#{value}'" - role = ::Installation::SystemRole.select(value) - - role.overlay_features - role.adapt_services - end - - private - - def roles_help_text - ::Installation::SystemRole.all.map { |r| "#{r.label}\n\n#{r.description}" }.join("\n\n\n") - end - end - - # CaaSP specialized role widget - class SystemRole < CWM::ComboBox - include SystemRoleReader - - def initialize(dashboard_widget) - textdomain "installation" - @dashboard_widget = dashboard_widget - end - - def opt - [:hstretch, :notify] - end - - alias_method :init_orig, :init - def init - init_orig - handle - end - - def handle - if value == "worker_role" - @dashboard_widget.show - else - @dashboard_widget.hide - end - - nil - end - end - - class SystemRolesRadioButtons < CWM::RadioButtons - include SystemRoleReader - - alias_method :store_orig, :store - def store - # set flag to show custom patterns only if custom role selected - CustomPatterns.show = value == "custom" - store_orig - - if value == "custom" - # for custom role do not use any desktop - Yast::DefaultDesktop.SetDesktop(nil) - else - # force reset of Default Desktop, because it is cached and when going - # forward and backward, it can be changed - Yast::DefaultDesktop.ForceReinit - end - end - - def vspacing - 1 - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/widgets/system_role_reader.rb new/yast2-installation-3.2.38/src/lib/installation/widgets/system_role_reader.rb --- old/yast2-installation-3.2.37/src/lib/installation/widgets/system_role_reader.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/src/lib/installation/widgets/system_role_reader.rb 2017-05-04 15:58:44.597375667 +0200 @@ -0,0 +1,64 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 SUSE LLC +# +# +# 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. +# +# To contact SUSE about this file by physical or electronic mail, you may find +# current contact information at www.suse.com. +# ------------------------------------------------------------------------------ +module Installation + module Widgets + # Common methods for system roles widgets + # + # @see Installation::Widgets::SystemRole + module SystemRoleReader + def default + ::Installation::SystemRole.default? ? ::Installation::SystemRole.ids.first : nil + end + + def init + self.value = ::Installation::SystemRole.current || default + end + + def label + Yast::ProductControl.GetTranslatedText("roles_caption") + end + + def items + ::Installation::SystemRole.all.map do |role| + [role.id, role.label] + end + end + + def help + Yast::ProductControl.GetTranslatedText("roles_help") + "\n\n" + roles_help_text + end + + def store + log.info "Applying system role '#{value}'" + role = ::Installation::SystemRole.select(value) + + role.overlay_features + role.adapt_services + end + + private + + def roles_help_text + ::Installation::SystemRole.all.map { |r| "#{r.label}\n\n#{r.description}" }.join("\n\n\n") + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/src/lib/installation/widgets/system_roles_radio_buttons.rb new/yast2-installation-3.2.38/src/lib/installation/widgets/system_roles_radio_buttons.rb --- old/yast2-installation-3.2.37/src/lib/installation/widgets/system_roles_radio_buttons.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/src/lib/installation/widgets/system_roles_radio_buttons.rb 2017-05-04 15:58:44.597375667 +0200 @@ -0,0 +1,60 @@ +# encoding: utf-8 + +# ------------------------------------------------------------------------------ +# Copyright (c) 2017 SUSE LLC +# +# +# 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. +# +# To contact SUSE about this file by physical or electronic mail, you may find +# current contact information at www.suse.com. +# ------------------------------------------------------------------------------ + +require "yast" +require "cwm/widget" +require "installation/services" +require "installation/custom_patterns" +require "installation/system_role" +require "installation/widgets/system_role_reader" + +Yast.import "DefaultDesktop" +Yast.import "ProductControl" +Yast.import "IP" +Yast.import "Hostname" + +module Installation + module Widgets + class SystemRolesRadioButtons < CWM::RadioButtons + include SystemRoleReader + + alias_method :store_orig, :store + def store + # set flag to show custom patterns only if custom role selected + CustomPatterns.show = value == "custom" + store_orig + + if value == "custom" + # for custom role do not use any desktop + Yast::DefaultDesktop.SetDesktop(nil) + else + # force reset of Default Desktop, because it is cached and when going + # forward and backward, it can be changed + Yast::DefaultDesktop.ForceReinit + end + end + + def vspacing + 1 + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/inst_casp_overview_test.rb new/yast2-installation-3.2.38/test/inst_casp_overview_test.rb --- old/yast2-installation-3.2.37/test/inst_casp_overview_test.rb 2017-04-07 14:59:25.142466244 +0200 +++ new/yast2-installation-3.2.38/test/inst_casp_overview_test.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,128 +0,0 @@ -#! /usr/bin/env rspec - -require_relative "test_helper" - -require "installation/clients/inst_casp_overview" - -Yast.import "CWM" -Yast.import "Language" -Yast.import "Mode" -Yast.import "Pkg" -Yast.import "Popup" -Yast.import "Wizard" - -# stub tune widgets used in dialog -require "cwm/widget" - -module Tune - module Widgets - class SystemInformation < CWM::PushButton - def label - "System Information" - end - end - end -end - -module Registration - module Widgets - class RegistrationCode < CWM::InputField - def label - "Registration code" - end - end - end -end - -module Users - class PasswordWidget < CWM::CustomWidget - def initialize(little_space: true) - end - - def label - "Password" - end - end -end - -module Y2Country - module Widgets - class KeyboardSelectionCombo < CWM::ComboBox - def initialize(_language) - end - - def label - "Keyboard" - end - end - end -end - -describe ::Installation::InstCaspOverview do - describe "#run" do - before do - allow(Yast::Wizard).to receive(:CreateDialog) - allow(Yast::Wizard).to receive(:CloseDialog) - allow(Yast::Pkg).to receive(:SetPackageLocale) - allow(Yast::CWM).to receive(:show).and_return(:next) - allow(Yast::Language).to receive(:language).and_return("en_US") - allow(Yast::WFM).to receive(:CallFunction).and_return({}) - allow(Yast::WFM).to receive(:CallFunction) - .with("inst_doit", []).and_return(:next) - allow(File).to receive(:exist?).and_call_original - allow(File).to receive(:exist?).with("/info.txt").and_return(false) - end - - it "sets package locale same as Language" do - expect(Yast::Pkg).to receive(:SetPackageLocale).with(Yast::Language.language) - - subject.run - end - - it "creates wizard dialog in normal mode" do - allow(Yast::Mode).to receive(:normal).and_return(true) - - expect(Yast::Wizard).to receive(:CreateDialog) - - subject.run - end - - it "closed wizard dialog in normal mode" do - allow(Yast::Mode).to receive(:normal).and_return(true) - - expect(Yast::Wizard).to receive(:CloseDialog) - - subject.run - end - - it "shows CWM widgets" do - allow(Yast::Mode).to receive(:normal).and_return(true) - - expect(Yast::CWM).to receive(:show).and_return(:next) - - subject.run - end - - it "adds caasp specific services to be enabled" do - subject.run - - expect(::Installation::Services.enabled).to include("cloud-init") - end - - it "displays the /info.txt file if it exists" do - expect(File).to receive(:exist?).with("/info.txt").and_return(true) - expect(Yast::InstShowInfo).to receive(:show_info_txt).with("/info.txt").and_return(true) - expect(Yast::CWM).to receive(:show).and_return(:next) - - subject.run - end - - it "does not try displaying the /info.txt file if it does not exist" do - expect(File).to receive(:exist?).with("/info.txt").and_return(false) - expect(Yast::InstShowInfo).to_not receive(:show_info_txt) - expect(Yast::CWM).to receive(:show).and_return(:next) - - subject.run - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/lib/widgets/hiding_place_test.rb new/yast2-installation-3.2.38/test/lib/widgets/hiding_place_test.rb --- old/yast2-installation-3.2.37/test/lib/widgets/hiding_place_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/test/lib/widgets/hiding_place_test.rb 2017-05-04 15:58:44.793375667 +0200 @@ -0,0 +1,52 @@ +#!/usr/bin/env rspec + +require_relative "../../test_helper" +require "installation/widgets/hiding_place" + +describe ::Installation::Widgets::HidingPlace do + subject(:place) { ::Installation::Widgets::HidingPlace.new(widget) } + let(:widget) { DummyWidget.new } + + class DummyWidget < CWM::InputField + def label + "Label" + end + + def init + @value = "current" + end + + attr_accessor :value + end + + describe "#show" do + it "shows the widget" do + expect(place).to receive(:replace).with(widget) + place.show + end + + it "restores the previous value" do + widget.value = "updated" + place.hide + place.show + expect(widget.value).to eq("updated") + end + end + + describe "#hide" do + it "hides the widget" do + expect(place).to receive(:replace).with(CWM::Empty) + place.hide + end + end + + describe "#store" do + it "restores the previous value" do + widget.value = "original" + place.store + widget.value = "forced" + place.show + expect(widget.value).to eq("original") + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/lib/widgets/system_role_reader_test.rb new/yast2-installation-3.2.38/test/lib/widgets/system_role_reader_test.rb --- old/yast2-installation-3.2.37/test/lib/widgets/system_role_reader_test.rb 2017-04-07 14:59:25.142466244 +0200 +++ new/yast2-installation-3.2.38/test/lib/widgets/system_role_reader_test.rb 2017-05-04 15:58:44.793375667 +0200 @@ -1,7 +1,7 @@ #!/usr/bin/env rspec require_relative "../../test_helper" -require "installation/widgets/system_role" +require "installation/widgets/system_role_reader" describe ::Installation::Widgets::SystemRoleReader do class DummySystemRoleReader diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/lib/widgets/system_roles_radio_buttons_test.rb new/yast2-installation-3.2.38/test/lib/widgets/system_roles_radio_buttons_test.rb --- old/yast2-installation-3.2.37/test/lib/widgets/system_roles_radio_buttons_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-installation-3.2.38/test/lib/widgets/system_roles_radio_buttons_test.rb 2017-05-04 15:58:44.793375667 +0200 @@ -0,0 +1,35 @@ +#!/usr/bin/env rspec + +require_relative "../../test_helper" +require "installation/widgets/system_roles_radio_buttons" + +describe Installation::Widgets::SystemRolesRadioButtons do + subject(:widget) { Installation::Widgets::SystemRolesRadioButtons.new } + + describe "#store" do + before do + allow(widget).to receive(:value).and_return(value) + allow(widget).to receive(:store_orig) + end + + context "when value is custom" do + let(:value) { "custom" } + + it "do not set any default desktop" do + expect(Installation::CustomPatterns).to receive(:show=).with(true) + expect(Yast::DefaultDesktop).to receive(:SetDesktop).with(nil) + widget.store + end + end + + context "when value is not custom" do + let(:value) { "server" } + + it "resets default desktop" do + expect(Installation::CustomPatterns).to receive(:show=).with(false) + expect(Yast::DefaultDesktop).to receive(:ForceReinit) + widget.store + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/widgets_overview_test.rb new/yast2-installation-3.2.38/test/widgets_overview_test.rb --- old/yast2-installation-3.2.37/test/widgets_overview_test.rb 2017-04-07 14:59:25.146466244 +0200 +++ new/yast2-installation-3.2.38/test/widgets_overview_test.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,128 +0,0 @@ -#! /usr/bin/env rspec - -require_relative "test_helper" - -require "installation/widgets/overview" - -# TODO: these shared examples will soon be available in yast2.rpm -# and then we can just `require "cwm/rspec"` -RSpec.shared_examples "CWM::AbstractWidget" do - context "these methods are only tested if they exist" do - describe "#label" do - it "produces a String" do - next unless subject.respond_to?(:label) - expect(subject.label).to be_a String - end - end - - describe "#help" do - it "produces a String" do - next unless subject.respond_to?(:help) - expect(subject.help).to be_a String - end - end - - describe "#opt" do - it "produces Symbols" do - next unless subject.respond_to?(:opt) - expect(subject.opt).to be_an Enumerable - subject.opt.each do |o| - expect(o).to be_a Symbol - end - end - end - - describe "#handle" do - it "produces a Symbol or nil" do - next unless subject.respond_to?(:handle) - m = subject.method(:handle) - args = m.arity == 0 ? [] : [:dummy_event] - expect(subject.handle(* args)).to be_a(Symbol).or be_nil - end - end - - describe "#validate" do - it "produces a Boolean (or nil)" do - next unless subject.respond_to?(:validate) - expect(subject.validate).to be(true).or be(false).or be_nil - end - end - end -end - -RSpec.shared_examples "CWM::CustomWidget" do - include_examples "CWM::AbstractWidget" - describe "#contents" do - it "produces a Term" do - expect(subject.contents).to be_a Yast::Term - end - end -end - -describe ::Installation::Widgets::Overview do - subject { ::Installation::Widgets::Overview.new(client: "adventure") } - let(:description) do - { - "menu_title" => "An Unexpected Journey" - } - end - let(:proposal) do - { - "label_proposal" => ["Walk to the Lonely Mountain", "Take Gold and Reign"] - } - end - let(:proposal_oops) do - { - "label_proposal" => ["Walk to the Lonely Mountain", "Take Gold and Reign"], - "warning" => "Dragon guarding the gold, no thief in your party", - "warning_level" => :fatal - } - end - - before do - allow(Yast::WFM).to receive(:CallFunction) - .with("adventure", ["Description", {}]) - .and_return(description) - allow(Yast::WFM).to receive(:CallFunction) - .with("adventure", ["MakeProposal", { "simple_mode" => true }]) - .and_return(proposal) - allow(Yast::WFM).to receive(:CallFunction) - .with("adventure", ["AskUser", {}]) - end - - include_examples "CWM::CustomWidget" - context "when there is a problem" do - before do - allow(Yast::WFM).to receive(:CallFunction) - .with("adventure", ["MakeProposal", { "simple_mode" => true }]) - .and_return(proposal_oops) - end - - describe "#validate" do - it "returns false" do - subject.contents - expect(subject.validate).to be false - end - end - end - - context "when there is a problem and the user corrects it" do - before do - allow(Yast::WFM).to receive(:CallFunction) - .with("adventure", ["MakeProposal", { "simple_mode" => true }]) - .and_return(proposal_oops, proposal) - end - - describe "#validate" do - it "first returns false, then returns true" do - subject.contents - expect(subject.validate).to be false - - subject.handle(:hire_mr_baggins) - - subject.contents - expect(subject.validate).to be true - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-installation-3.2.37/test/widgets_system_role_test.rb new/yast2-installation-3.2.38/test/widgets_system_role_test.rb --- old/yast2-installation-3.2.37/test/widgets_system_role_test.rb 2017-04-07 14:59:25.146466244 +0200 +++ new/yast2-installation-3.2.38/test/widgets_system_role_test.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,62 +0,0 @@ -#! /usr/bin/env rspec - -require_relative "test_helper" - -require "installation/widgets/system_role" - -describe ::Installation::Widgets::ControllerNode do - let(:worker_role) { ::Installation::SystemRole.new(id: "worker_role") } - - before do - allow(subject).to receive(:role).and_return(worker_role) - end - - it "has label" do - expect(subject.label).to_not be_empty - end - - context "initialization" do - it "is initialized with the previously stored value if present" do - worker_role["controller_node"] = "previous_location" - - expect(subject).to receive(:value=).with("previous_location") - - subject.init - end - end - - context "store" do - it "stores current value" do - expect(subject).to receive(:value).and_return("value_to_store") - - expect(worker_role).to receive("[]=").with("controller_node", "value_to_store") - - subject.store - end - end - - context "validation" do - it "reports an error if the current value is not a valid IP or FQDN and returns false" do - allow(Yast::IP).to receive(:Check).and_return(false) - allow(Yast::Hostname).to receive(:CheckFQ).and_return(false) - expect(Yast::Popup).to receive(:Error) - - expect(subject.validate).to eql(false) - end - - it "returns true if the current value is a valid IP" do - allow(Yast::IP).to receive(:Check).and_return(true) - allow(Yast::Hostname).to receive(:CheckFQ).and_return(false) - - expect(subject.validate).to eql(true) - end - - it "returns true if the current value is a valid FQDN" do - allow(Yast::IP).to receive(:Check).and_return(false) - allow(Yast::Hostname).to receive(:CheckFQ).and_return(true) - - expect(subject.validate).to eql(true) - end - end - -end