Skip to content

Commit

Permalink
remove access to autoyast profile unless it is necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jul 9, 2020
1 parent 50d434f commit 131f525
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/lib/installation/clients/inst_update_installer.rb
Expand Up @@ -172,8 +172,7 @@ def disabled_in_linuxrc?
#
# @return [Boolean] true if self update has been disabled by AutoYaST profile
def disabled_in_profile?
profile = Yast::Profile.current
!profile.fetch("general", {}).fetch("self_update", true)
!(AutoinstGeneral.self_update?.nil? || AutoinstGeneral.self_update?)
end

# Return the self-update URLs
Expand Down
5 changes: 2 additions & 3 deletions src/lib/installation/minimal_installation.rb
Expand Up @@ -14,9 +14,8 @@ def enabled

Yast.import "Mode"
if Yast::Mode.autoinst
Yast.import "Profile"
profile = Yast::Profile.current
@enabled = if profile["general"] && profile["general"]["minimal-configuration"]
Yast.import "AutoinstGeneral"
@enabled = if Yast::AutoinstGeneral.minimal_installation?
true
else
false
Expand Down
4 changes: 2 additions & 2 deletions src/lib/installation/update_repositories_finder.rb
Expand Up @@ -105,8 +105,8 @@ def update_url_from_linuxrc
def update_url_from_profile
return nil unless Yast::Mode.auto

profile = Yast::Profile.current
profile_url = profile.fetch("general", {})["self_update_url"]
Yast.import "AutoinstGeneral"
profile_url = Yast::AutoinstGeneral.self_update_url

get_url_from(profile_url)
end
Expand Down
5 changes: 2 additions & 3 deletions src/modules/InstFunctions.rb
Expand Up @@ -34,12 +34,12 @@ class InstFunctionsClass < Module
def main
textdomain "installation"

Yast.import "AutoinstGeneral"
Yast.import "Linuxrc"
Yast.import "AutoinstConfig"
Yast.import "Stage"
Yast.import "Mode"
Yast.import "ProductControl"
Yast.import "Profile"
Yast.import "SCR"
end

Expand Down Expand Up @@ -149,8 +149,7 @@ def self_update_explicitly_enabled?

return false unless Mode.auto

profile = Profile.current
in_profile = profile.fetch("general", {}).fetch("self_update", false)
in_profile = AutoinstGeneral.self_update?
log.info("Self update was enabled explicitly by the AY profile") if in_profile
in_profile
end
Expand Down

0 comments on commit 131f525

Please sign in to comment.