Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-registration for 
openSUSE:Factory checked in at 2022-02-01 14:02:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-registration.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration"

Tue Feb  1 14:02:43 2022 rev:83 rq:950201 version:4.4.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes    
2022-01-25 17:37:02.441933258 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-registration.new.1898/yast2-registration.changes
  2022-02-01 14:03:10.675981884 +0100
@@ -1,0 +2,16 @@
+Mon Jan 31 11:36:53 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Do not read registration codes from a USB stick when using
+  AutoYaST to upgrade a system with the online installation medium
+  (related to bsc#1194440).
+- 4.4.15
+
+-------------------------------------------------------------------
+Fri Jan 28 14:04:30 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Handle service name collision during upgrade (bsc#1194453),
+  do not delete the new services which have the same name
+  as an old service
+- 4.4.14
+
+-------------------------------------------------------------------

Old:
----
  yast2-registration-4.4.13.tar.bz2

New:
----
  yast2-registration-4.4.15.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.q9l7cT/_old  2022-02-01 14:03:11.263977853 +0100
+++ /var/tmp/diff_new_pack.q9l7cT/_new  2022-02-01 14:03:11.267977825 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.4.13
+Version:        4.4.15
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -27,8 +27,8 @@
 Source0:        %{name}-%{version}.tar.bz2
 
 BuildRequires:  update-desktop-files
-# ProductSpec API
-BuildRequires:  yast2 >= 4.4.21
+# Y2Packager::NewRepositorySetup
+BuildRequires:  yast2 >= 4.4.42
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
@@ -41,8 +41,8 @@
 # yast/rspec/helpers.rb
 BuildRequires:  yast2-ruby-bindings >= 4.4.7
 
-# ProductSpec API
-Requires:       yast2 >= 4.4.21
+# Y2Packager::NewRepositorySetup
+Requires:       yast2 >= 4.4.42
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method

++++++ yast2-registration-4.4.13.tar.bz2 -> yast2-registration-4.4.15.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.13/package/yast2-registration.changes 
new/yast2-registration-4.4.15/package/yast2-registration.changes
--- old/yast2-registration-4.4.13/package/yast2-registration.changes    
2022-01-24 18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/package/yast2-registration.changes    
2022-01-31 14:25:19.000000000 +0100
@@ -1,4 +1,20 @@
 -------------------------------------------------------------------
+Mon Jan 31 11:36:53 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Do not read registration codes from a USB stick when using
+  AutoYaST to upgrade a system with the online installation medium
+  (related to bsc#1194440).
+- 4.4.15
+
+-------------------------------------------------------------------
+Fri Jan 28 14:04:30 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Handle service name collision during upgrade (bsc#1194453),
+  do not delete the new services which have the same name
+  as an old service
+- 4.4.14
+
+-------------------------------------------------------------------
 Mon Jan 24 15:29:29 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
 
 - Fix detection of base products coming from SCC (bsc#1194989).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.13/package/yast2-registration.spec 
new/yast2-registration-4.4.15/package/yast2-registration.spec
--- old/yast2-registration-4.4.13/package/yast2-registration.spec       
2022-01-24 18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/package/yast2-registration.spec       
2022-01-31 14:25:19.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.4.13
+Version:        4.4.15
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -27,8 +27,8 @@
 Source0:        %{name}-%{version}.tar.bz2
 
 BuildRequires:  update-desktop-files
-# ProductSpec API
-BuildRequires:  yast2 >= 4.4.21
+# Y2Packager::NewRepositorySetup
+BuildRequires:  yast2 >= 4.4.42
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
@@ -41,8 +41,8 @@
 # yast/rspec/helpers.rb
 BuildRequires:  yast2-ruby-bindings >= 4.4.7
 
-# ProductSpec API
-Requires:       yast2 >= 4.4.21
+# Y2Packager::NewRepositorySetup
+Requires:       yast2 >= 4.4.42
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.13/src/lib/registration/clients/scc_auto.rb 
new/yast2-registration-4.4.15/src/lib/registration/clients/scc_auto.rb
--- old/yast2-registration-4.4.13/src/lib/registration/clients/scc_auto.rb      
2022-01-24 18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/src/lib/registration/clients/scc_auto.rb      
2022-01-31 14:25:19.000000000 +0100
@@ -95,7 +95,11 @@
         # merge reg code if not defined in the profile but
         # available from other sources
         product = Yast::AutoinstFunctions.selected_product
-        if product && !settings["reg_code"]
+        # If the real product (an instance from the Product class) is not
+        # available (e.g. Online medium), just skip reading the regcode because
+        # the short_name (which is required to find the regcode) is unknown at
+        # this point. See bsc#1194440.
+        if product&.respond_to?(:short_name) && !settings["reg_code"]
           reg_codes_loader = ::Registration::Storage::RegCodes.instance
           settings["reg_code"] = 
reg_codes_loader.reg_codes[product.short_name] || ""
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.13/src/lib/registration/registration.rb 
new/yast2-registration-4.4.15/src/lib/registration/registration.rb
--- old/yast2-registration-4.4.13/src/lib/registration/registration.rb  
2022-01-24 18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/src/lib/registration/registration.rb  
2022-01-31 14:25:19.000000000 +0100
@@ -21,6 +21,7 @@
 
 require "ostruct"
 require "yast"
+require "y2packager/new_repository_setup"
 require "suse/connect"
 require "registration/connect_helpers"
 
@@ -71,6 +72,8 @@
 
         service = SUSE::Connect::YaST.activate_product(product_ident, params, 
email)
         log.info "Register product result: #{service}"
+        # remember the new service, might be useful later
+        Y2Packager::NewRepositorySetup.instance.add_service(service.name)
         set_registered(product_ident)
 
         renames = collect_renames([service.product])
@@ -85,6 +88,8 @@
         log.info "Upgrading product: #{product}"
         service = SUSE::Connect::YaST.upgrade_product(product_ident, params)
         log.info "Upgrade product result: #{service}"
+        # remember the new service to not accidentally delete it as an old 
service
+        Y2Packager::NewRepositorySetup.instance.add_service(service.name)
         # skip loading the remote addons in offline upgrade, there is a 
confusion
         # between installed and the upgraded product, moreover we do not need 
the
         # addons list at all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.4.13/test/registration/clients/scc_auto_test.rb 
new/yast2-registration-4.4.15/test/registration/clients/scc_auto_test.rb
--- old/yast2-registration-4.4.13/test/registration/clients/scc_auto_test.rb    
2022-01-24 18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/test/registration/clients/scc_auto_test.rb    
2022-01-31 14:25:19.000000000 +0100
@@ -1,6 +1,7 @@
 #! /usr/bin/env rspec
 
 require_relative "../../spec_helper"
+require "y2packager/control_product_spec"
 
 describe Registration::Clients::SCCAuto do
   let(:config) { ::Registration::Storage::Config.instance }
@@ -32,8 +33,59 @@
   end
 
   describe "#import" do
+    let(:config) do
+      instance_double(Registration::Storage::Config)
+    end
+
+    let(:product) do
+      instance_double(Y2Packager::Product, short_name: "SLES15-SP4")
+    end
+
+    before do
+      allow(Yast::AutoinstFunctions).to 
receive(:selected_product).and_return(product)
+      allow(Registration::Storage::Config).to 
receive(:instance).and_return(config)
+    end
+
     it "imports given hash" do
-      expect { subject.import({}) }.to_not raise_error
+      expect(config).to receive(:import).with("reg_code" => "SOME-CODE")
+      subject.import("reg_code" => "SOME-CODE")
+    end
+
+    context "when the registration code is not specified" do
+      let(:loader) do
+        instance_double(Registration::Storage::RegCodes, reg_codes: reg_codes)
+      end
+
+      let(:reg_codes) do
+        { "SLES15-SP4" => "INTERNAL-USE-ONLY" }
+      end
+
+      before do
+        allow(Registration::Storage::RegCodes).to 
receive(:instance).and_return(loader)
+      end
+
+      it "reads the code from the registration codes loader" do
+        expect(config).to receive(:import).with("reg_code" => 
"INTERNAL-USE-ONLY")
+        subject.import({})
+      end
+
+      context "but respositories are not initialized yet" do
+        let(:product) { instance_double(Y2Packager::ControlProductSpec) }
+
+        it "does not read the code from the registration codes loader" do
+          expect(config).to receive(:import).with({})
+          subject.import({})
+        end
+      end
+
+      context "but the selected product is unknown" do
+        let(:product) { nil }
+
+        it "does not read the code from the registration codes loader" do
+          expect(config).to receive(:import).with({})
+          subject.import({})
+        end
+      end
     end
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.4.13/test/registration_spec.rb 
new/yast2-registration-4.4.15/test/registration_spec.rb
--- old/yast2-registration-4.4.13/test/registration_spec.rb     2022-01-24 
18:23:49.000000000 +0100
+++ new/yast2-registration-4.4.15/test/registration_spec.rb     2022-01-31 
14:25:19.000000000 +0100
@@ -68,6 +68,8 @@
       allow(SUSE::Connect::YaST).to receive(:credentials)
         .with(SUSE::Connect::YaST::GLOBAL_CREDENTIALS_FILE)
         .and_return(OpenStruct.new(username: "SCC_foo", password: "bar"))
+
+      allow_any_instance_of(Y2Packager::NewRepositorySetup).to 
receive(:add_service)
     end
 
     it "adds the selected product and returns added zypp services" do
@@ -82,6 +84,13 @@
 
       subject.send(yast_method, product)
     end
+
+    it "stores the added service name" do
+      expect_any_instance_of(Y2Packager::NewRepositorySetup).to \
+        receive(:add_service).with("service")
+
+      subject.send(yast_method, product)
+    end
   end
 
   describe "#register_product" do

Reply via email to