Script 'mail_helper' called by ro Hello packager, This is just FYI. Your package was checked in in distribution "sle12" by autobuild-member: ro. Here comes the log... ---------------------------%<------------------------------ Hi, here is the log from ci_new_pac /mounts/work_src_done/SLE12/yast2-registration -> sle12 ## BNC# 889778 : "Product Update with SMT (SLES11 => SLES12) do not work because of old distro target data on SMT" (NEW/) Changes: -------- --- /work/SRC/SUSE:SLE-12:GA/yast2-registration/yast2-registration.changes 2014-09-08 14:12:27.000000000 +0200 +++ /mounts/work_src_done/SLE12/yast2-registration/yast2-registration.changes 2014-09-10 16:44:12.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Sep 10 08:37:34 UTC 2014 - lslezak@suse.cz + +- update the system registration in update mode, set the new target + distribution value (needed for update via SMT, bnc#889778) +- 3.1.120 + +------------------------------------------------------------------- calling whatdependson for sle12-i586 Packages directly triggered for rebuild: - yast2-registration ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/SUSE:SLE-12:GA/yast2-registration (Old) and /mounts/work_src_done/SLE12/yast2-registration (BS:build ID:44043 MAIL:yast-commit@opensuse.org) (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-registration", Maintainer is "yast-commit@opensuse.org" Old: ---- yast2-registration-3.1.119.tar.bz2 New: ---- yast2-registration-3.1.120.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.dUrete/_old 2014-09-10 17:17:04.000000000 +0200 +++ /var/tmp/diff_new_pack.dUrete/_new 2014-09-10 17:17:04.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.119 +Version: 3.1.120 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-3.1.119.tar.bz2 -> yast2-registration-3.1.120.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/.yardopts new/yast2-registration-3.1.120/.yardopts --- old/yast2-registration-3.1.119/.yardopts 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-registration-3.1.120/.yardopts 2014-09-10 16:53:52.000000000 +0200 @@ -0,0 +1,5 @@ +--no-private +--protected +--markup markdown +--readme README.md +src/**/*.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/package/yast2-registration.changes new/yast2-registration-3.1.120/package/yast2-registration.changes --- old/yast2-registration-3.1.119/package/yast2-registration.changes 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/package/yast2-registration.changes 2014-09-10 16:53:52.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Sep 10 08:37:34 UTC 2014 - lslezak@suse.cz + +- update the system registration in update mode, set the new target + distribution value (needed for update via SMT, bnc#889778) +- 3.1.120 + +------------------------------------------------------------------- Mon Sep 8 08:36:48 UTC 2014 - lslezak@suse.cz - ask for installing updates _after_ successfuly registering the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/package/yast2-registration.spec new/yast2-registration-3.1.120/package/yast2-registration.spec --- old/yast2-registration-3.1.119/package/yast2-registration.spec 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/package/yast2-registration.spec 2014-09-10 16:53:52.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 3.1.119 +Version: 3.1.120 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/src/clients/inst_scc.rb new/yast2-registration-3.1.120/src/clients/inst_scc.rb --- old/yast2-registration-3.1.119/src/clients/inst_scc.rb 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/src/clients/inst_scc.rb 2014-09-10 16:53:52.000000000 +0200 @@ -170,6 +170,14 @@ return ret end + # update system registration, update the target distribution + # @return [Boolean] true on success + def update_system_registration + return false if init_registration == :cancel + registration_ui.update_system + end + + # @return [Boolean] true on success def refresh_base_product return false if init_registration == :cancel @@ -183,7 +191,7 @@ # #get_available_addons will not return :cancel if # #refresh_base_product returned a positive value, but # it's better to stay safe and abort nicely. - return :cancel + return false end failed_addons = registration_ui.update_addons(addons, enable_updates: install_updates?) @@ -191,7 +199,7 @@ # if update fails preselest the addon for full registration failed_addons.each(&:selected) - :next + true end # display the registration update dialog @@ -208,8 +216,9 @@ def update_registration show_registration_update_dialog - if refresh_base_product - return refresh_addons + if update_system_registration && refresh_base_product && refresh_addons + log.info "Registration update succeeded" + :next else # automatic registration refresh during system upgrade failed, register from scratch Report.Error(_("Automatic registration upgrade failed.\n" + @@ -618,6 +627,8 @@ "select_addons" : "check" end + # initialize the Registration object + # @return [Symbol, nil] returns :cancel if the URL selection was canceled def init_registration if !@registration url = ::Registration::UrlHelpers.registration_url diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/src/clients/scc_auto.rb new/yast2-registration-3.1.120/src/clients/scc_auto.rb --- old/yast2-registration-3.1.119/src/clients/scc_auto.rb 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/src/clients/scc_auto.rb 2014-09-10 16:53:52.000000000 +0200 @@ -196,7 +196,7 @@ end # find registration server via SLP - # @retun [String,nil] URL of the server, nil on error + # @return [String,nil] URL of the server, nil on error def find_slp_server # do SLP query slp_services = ::Registration::UrlHelpers.slp_discovery_feedback @@ -263,6 +263,7 @@ # the old system was not registered return false unless prepare_update + return false unless update_system_registration return false unless update_base_product return false unless update_addons @@ -310,6 +311,11 @@ end # @return [Boolean] true on success + def update_system_registration + registration_ui.update_system + end + + # @return [Boolean] true on success def update_base_product registration_ui.update_base_product(enable_updates: @config.install_updates) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/src/lib/registration/new_messages.rb new/yast2-registration-3.1.120/src/lib/registration/new_messages.rb --- old/yast2-registration-3.1.119/src/lib/registration/new_messages.rb 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/src/lib/registration/new_messages.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ - -# this is just a placeholder for texts which will/might be needed after the text freeze -# TODO FIXME: remove this file before GM! - -textdomain "registration" - -NEW_TEXTS = [ - _("SSL Certificate"), - # checkbox: use SLP discovery later again in the installed system - _("Use SLP Discovery Also Later in Installed System") -] - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/src/lib/registration/registration.rb new/yast2-registration-3.1.120/src/lib/registration/registration.rb --- old/yast2-registration-3.1.119/src/lib/registration/registration.rb 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/src/lib/registration/registration.rb 2014-09-10 16:53:52.000000000 +0200 @@ -79,6 +79,15 @@ end end + # @param [String] target_distro new target distribution + # @return [OpenStruct] SCC response + def update_system(target_distro = nil) + log.info "Updating the system, new target distribution: #{target_distro}" + ret = SUSE::Connect::YaST.update_system(connect_params, target_distro) + log.info "Update result: #{ret}" + ret + end + def get_addon_list # extensions for base product base_product = ::Registration::SwMgmt.base_product_to_register @@ -92,7 +101,7 @@ :release_type => base_product["release_type"] ) - params = connect_params({}) + params = connect_params addons = SUSE::Connect::YaST.show_product(remote_product, params).extensions || [] log.info "Available addons result: #{addons}" @@ -105,7 +114,7 @@ def activated_products log.info "Reading activated products..." - activated = SUSE::Connect::YaST.status(connect_params({})).activated_products || [] + activated = SUSE::Connect::YaST.status(connect_params).activated_products || [] log.info "Activated products: #{activated.map(&:id)}" activated end @@ -128,7 +137,7 @@ log.info "Using product: #{remote_product}" - params = connect_params({}) + params = connect_params # use product specific reg. code (e.g. for addons) if (product.is_a?(Hash) && product["reg_code"]) @@ -173,7 +182,7 @@ SslCertificate.load(context.current_cert) : nil end - def connect_params(params) + def connect_params(params = {}) default_params = { :language => ::Registration::Helpers.language, :debug => ENV["SCCDEBUG"], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/src/lib/registration/registration_ui.rb new/yast2-registration-3.1.120/src/lib/registration/registration_ui.rb --- old/yast2-registration-3.1.119/src/lib/registration/registration_ui.rb 2014-09-08 12:38:58.000000000 +0200 +++ new/yast2-registration-3.1.120/src/lib/registration/registration_ui.rb 2014-09-10 16:53:52.000000000 +0200 @@ -82,8 +82,31 @@ [success, product_service] end + # @return [Boolean] true on success + def update_system + updated = ConnectHelpers.catch_registration_errors(show_update_hint: true) do + base_product = SwMgmt.find_base_product + target_distro = base_product["register_target"] + + Yast::Popup.Feedback( + _(CONTACTING_MESSAGE), + # TODO FIXME: reused an existing message due to text freeze + # (later use a better text, it's system update actually...) + _("Registering the System...") + ) do + registration.update_system(target_distro) + end + end + + if !updated + log.info "System update failed, removing the credentials to register from scratch" + Helpers.reset_registration_status + end + + updated + end - # @parama [Boolean] enable_updates Enable or disable added update repositories + # @param [Boolean] enable_updates Enable or disable added update repositories # @return [Boolean] true on success def update_base_product(enable_updates: true) upgraded = ConnectHelpers.catch_registration_errors(show_update_hint: true) do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/test/registration_spec.rb new/yast2-registration-3.1.120/test/registration_spec.rb --- old/yast2-registration-3.1.119/test/registration_spec.rb 2014-09-08 12:38:59.000000000 +0200 +++ new/yast2-registration-3.1.120/test/registration_spec.rb 2014-09-10 16:53:52.000000000 +0200 @@ -15,7 +15,7 @@ allow(Registration::Helpers).to receive(:insecure_registration).and_return(false) end - describe ".register" do + describe "#register" do it "registers the system using the provided registration code" do username = "user" password = "password" @@ -66,15 +66,23 @@ end end - describe ".register_product" do + describe "#register_product" do it_should_behave_like "add_product", :activate_product, :register_product end - describe ".upgrade_product" do + describe "#upgrade_product" do it_should_behave_like "add_product", :upgrade_product, :upgrade_product end - describe ".activated_products" do + describe "#update_system" do + it "updates the system registration with the new target distro" do + target_distro = "sles-12-x86_64" + expect(SUSE::Connect::YaST).to receive(:update_system).with(anything, target_distro) + Registration::Registration.new.update_system(target_distro) + end + end + + describe "#activated_products" do it "returns list of activated products" do expect(SUSE::Connect::Status).to receive(:activated_products).and_return([]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-3.1.119/test/registration_ui_test.rb new/yast2-registration-3.1.120/test/registration_ui_test.rb --- old/yast2-registration-3.1.119/test/registration_ui_test.rb 2014-09-08 12:38:59.000000000 +0200 +++ new/yast2-registration-3.1.120/test/registration_ui_test.rb 2014-09-10 16:53:52.000000000 +0200 @@ -8,15 +8,19 @@ describe "Registration::RegistrationUI" do let(:registration) { Registration::Registration.new } let(:registration_ui) { Registration::RegistrationUI.new(registration) } + let(:target_distro) { "sles-12-x86_64" } + let(:base_product) do + { + "arch" => "x86_64", "name" => "SLES", "version" => "12", + "flavor" => "DVD", "register_target" => target_distro + } + end describe "#register_system_and_base_product" do it "registers the system using the provided registration code" do email = "user@example.com" reg_code = "reg_code" - - target_distro = "sles-12-x86_64" - base_product = { "arch" => "x86_64", "name" => "SLES", "version" => "12", - "flavor" => "DVD", "register_target" => target_distro } + base_product_to_register = { "name"=>"SLES", "arch"=>"x86_64", "version"=>"12", "release_type"=>"DVD", "reg_code"=>"reg_code" } @@ -37,4 +41,13 @@ end end + describe "#update_system" do + it "updates the system registration with the new target distro" do + expect(Registration::SwMgmt).to receive(:find_base_product).and_return(base_product) + expect(registration).to receive(:update_system).with(target_distro) + + expect(registration_ui.update_system).to be_true + end + end + end continue with "q"... Checked in at Wed Sep 10 17:17:28 CEST 2014 by ro Remember to have fun... -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org