Skip to content

Commit

Permalink
Merge fafc9f7 into 228b307
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 14, 2020
2 parents 228b307 + fafc9f7 commit 27f9c55
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
6 changes: 6 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jan 14 15:04:15 UTC 2020 - Josef Reidinger <jreidinger@suse.com>

- fix crash in autoyast registration (bsc#1160909)
- 4.2.25

-------------------------------------------------------------------
Fri Jan 10 14:16:55 UTC 2020 - Ladislav Slezák <lslezak@suse.cz>

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-registration.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 4.2.24
Version: 4.2.25
Release: 0
Summary: YaST2 - Registration Module
License: GPL-2.0-only
Expand Down
6 changes: 3 additions & 3 deletions src/lib/registration/clients/scc_auto.rb
Expand Up @@ -130,7 +130,7 @@ def write

# special handling for the online installation medium,
# we need to evaluate the base products defined in the control.xml
if Y2Packager::MediumType.online?
if Yast::Stage.initial && Y2Packager::MediumType.online?
return false unless online_medium_config
end

Expand Down Expand Up @@ -335,10 +335,10 @@ def register_base_product
# register the addons specified in the profile
def register_addons
# set the option for installing the updates for addons
options = Registration::Storage::InstallationOptions.instance
options = ::Registration::Storage::InstallationOptions.instance
options.install_updates = @config.install_updates

ay_addons_handler = Registration::AutoyastAddons.new(@config.addons, registration)
ay_addons_handler = ::Registration::AutoyastAddons.new(@config.addons, registration)
ay_addons_handler.select
ay_addons_handler.register

Expand Down
22 changes: 22 additions & 0 deletions test/registration/clients/scc_auto_test.rb
Expand Up @@ -101,6 +101,28 @@ def self.current
subject.write
end

it "registers previously registered base system and addons" do
allow(Yast::Mode).to receive(:update).and_return(false)
subject.import(
"do_registration" => true,
"addons" => [{
"name" => "sle-module-basesystem",
"version" => "15.2",
"arch" => "x86_64"
}]
)

allow(subject).to receive(:registration_ui).and_return(
double(register_system_and_base_product: true, disable_update_repos: true)
)

addon = double.as_null_object
expect(Registration::AutoyastAddons).to receive(:new).and_return(addon)
expect(addon).to receive(:register)

subject.write
end

context "in autoupgrade mode" do
before do
allow(Yast::Mode).to receive(:update).and_return(true)
Expand Down

0 comments on commit 27f9c55

Please sign in to comment.