Skip to content

Commit

Permalink
Merge pull request #229 from yast/SLE12backport
Browse files Browse the repository at this point in the history
SLE12 backport of the addon upgrade fix
  • Loading branch information
lslezak committed Oct 19, 2015
2 parents 44f618c + 16774a2 commit 28bd6a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
7 changes: 7 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Oct 19 07:21:58 UTC 2015 - lslezak@suse.cz

- Addon upgrade - fixed crash when upgrading installed addon
(undefined method) (bsc#950795)
- 3.1.129.14

-------------------------------------------------------------------
Mon Oct 12 12:03:53 UTC 2015 - 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: 3.1.129.13
Version: 3.1.129.14
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
2 changes: 1 addition & 1 deletion src/lib/registration/registration.rb
Expand Up @@ -132,7 +132,7 @@ def get_addon_list

remote_product = SwMgmt.remote_product(base_product)
addons = SUSE::Connect::YaST.show_product(remote_product, connect_params).extensions || []
log.info "Available addons result: #{addons}"
addons.each { |a| log.info "Found available addon: #{a.inspect}" }

renames = collect_renames(addons)
::Registration::SwMgmt.update_product_renames(renames)
Expand Down
7 changes: 6 additions & 1 deletion src/lib/registration/registration_ui.rb
Expand Up @@ -135,9 +135,11 @@ def update_base_product
[upgraded, product_service]
end

# @param [Array<Registration::Addon>] addons to update
def update_addons(addons, enable_updates: true)
# find addon updates
addons_to_update = SwMgmt.find_addon_updates(addons)
log.info "addons to update: #{addons_to_update.inspect}"

failed_addons = addons_to_update.reject do |addon_to_update|
ConnectHelpers.catch_registration_errors do
Expand Down Expand Up @@ -370,6 +372,8 @@ def select_repositories(product_service)
SwMgmt.set_repos_state(updates, install_updates?)
end

# update addon registration to a new version
# @param [Registration::Addon] addon addon to update
def update_addon(addon, enable_updates)
ConnectHelpers.catch_registration_errors do
# then register the product(s)
Expand All @@ -378,7 +382,8 @@ def update_addon(addon, enable_updates)
# updating registered addon/extension, %s is an extension name
_("Updating to %s ...") % addon.label
) do
registration.upgrade_product(addon)
# FIXME: unify with add-on upgrade in online migration
registration.upgrade_product(SwMgmt.remote_product(addon.to_h))
end

Storage::Cache.instance.addon_services << product_service
Expand Down

0 comments on commit 28bd6a9

Please sign in to comment.