Skip to content

Commit

Permalink
improve code (code review fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Sep 1, 2014
1 parent 8a5d60c commit fb9811d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/clients/inst_scc.rb
Expand Up @@ -137,8 +137,6 @@ def register_base_system

next if init_registration == :cancel

# TODO FIXME use @registration_ui instead of @registration everywhere
registration_ui = ::Registration::RegistrationUI.new(@registration)
success = registration_ui.register_system_and_base_product(email, reg_code,
register_base_product: !options.base_registered, disable_updates: !install_updates?)

Expand Down Expand Up @@ -171,7 +169,6 @@ def register_base_system
def refresh_base_product
return false if init_registration == :cancel

registration_ui = ::Registration::RegistrationUI.new(@registration)
registration_ui.update_base_product(enable_updates: install_updates?)
end

Expand All @@ -185,7 +182,6 @@ def refresh_addons
return :cancel
end

registration_ui = ::Registration::RegistrationUI.new(@registration)
failed_addons = registration_ui.update_addons(addons, enable_updates: install_updates?)

# if update fails preselest the addon for full registration
Expand Down Expand Up @@ -349,7 +345,6 @@ def get_available_addons
# cache the available addons
return :cancel if init_registration == :cancel

registration_ui = ::Registration::RegistrationUI.new(@registration)
registration_ui.get_available_addons
end

Expand Down Expand Up @@ -541,6 +536,10 @@ def pkg_manager
WFM.call("sw_single")
end

def registration_ui
::Registration::RegistrationUI.new(@registration)
end

# UI workflow definition
def start_workflow
aliases = {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/registration/registration_ui.rb
Expand Up @@ -53,9 +53,9 @@ def register_system_and_base_product(email, reg_code,

success = ConnectHelpers.catch_registration_errors do
base_product = SwMgmt.find_base_product
distro_target = base_product["register_target"]

if !Registration.is_registered?
distro_target = base_product["register_target"]
log.info "Registering system, distro_target: #{distro_target}"

Yast::Popup.Feedback(_(CONTACTING_MESSAGE),
Expand Down

0 comments on commit fb9811d

Please sign in to comment.