Skip to content

Commit

Permalink
added suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
schubi2 committed Apr 11, 2018
1 parent dcf4ae6 commit e2ebd69
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package/yast2-packager.changes
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
Tue Apr 10 16:21:29 CEST 2018 - schubi@suse.de

- Error: Add-On products has been reset while the installation
- Error: Add-On products has been reset during the installation
workflow (bnc#1086846). Set it again while setting the base
product.
- 4.0.56
Expand Down
6 changes: 3 additions & 3 deletions src/modules/AddOnProduct.rb
Expand Up @@ -158,8 +158,8 @@ def main
# @see #add_rename
@external_product_renames = {}

# Products which are selected for installation in libzypp. Due the
# Due the "buddy" libypp functionality alse the release packages will
# Products which are selected for installation in libzypp.
# Due the "buddy" libzypp functionality also the release packages will
# be regarded.
# E.g.: product:sle-module-basesystem-15-0.x86_64 has buddy
# sle-module-basesystem-release-15-91.2.x86_64
Expand Down Expand Up @@ -1271,7 +1271,7 @@ def InstallProductsFromRepository(prods_to_install, src)
"Selecting product '%1' for installation",
Ops.get_string(p, "name", "")
)
one_prod = Ops.get_string(p, "name", "")
one_prod = p["name"] || ""
Pkg.ResolvableInstall(one_prod, :product)
@selected_installation_products << one_prod
end
Expand Down
14 changes: 9 additions & 5 deletions test/addon_product_test.rb
Expand Up @@ -306,17 +306,21 @@
:product).and_return(false)
allow(subject).to receive(:ReIntegrateFromScratch)
allow(subject).to receive(:Integrate)
end

it "adds the repository and reports error for none existing products" do
expect(Yast::Report).to receive(:Error)
.with(format(_("Product %s not found on media."), "not_available_product"))
expect(subject).to receive(:AddRepo).with(repo["url"], repo["path"], repo["priority"])
.and_return(repo_id)
end

it "adds the repository" do
subject.AddPreselectedAddOnProducts(filelist)
expect(subject.add_on_products).to_not be_empty
expect(subject.selected_installation_products).to eq(["available_product"])
end

it "reports an error for none existing products" do
expect(Yast::Report).to receive(:Error)
.with(format(_("Product %s not found on media."), "not_available_product"))
subject.AddPreselectedAddOnProducts(filelist)
end
end

context "when the add-on is on a CD/DVD" do
Expand Down

0 comments on commit e2ebd69

Please sign in to comment.