Skip to content

Commit

Permalink
chagnes from review
Browse files Browse the repository at this point in the history
  • Loading branch information
jreidinger committed Jan 16, 2017
1 parent e8cfe40 commit 236e6a6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/lib/installation/clients/inst_extrasources.rb
Expand Up @@ -245,7 +245,10 @@ def GetURLsToRegister(registered)
# Register the installation sources in offline mode (no network connection required).
# The repository metadata will be downloaded by sw_single (or another yast module) when the repostory is enabled
#
# @param url_list [Array<Hash>] list of the sources to register
# @param url_list [Array<Hash>] list of the sources to register. Following
# keys are recognized with default in brackets:
# "enabled" (false), "autorefresh" (true), "name" ("alias"("baseurl"(""))),
# "alias ("baseurl"("")), "baseurl" (["baseurls"]), "prod_dir", "priority"
# @return [Array<Fixnum>] list of created source IDs
def RegisterRepos(url_list)
url_list = deep_copy(url_list)
Expand Down
3 changes: 3 additions & 0 deletions src/lib/installation/select_system_role.rb
Expand Up @@ -183,6 +183,7 @@ def role_buttons
RadioButtonGroup(Id(:roles), ui_roles)
end

# Applies given role to configuration
def apply_role(role_id)
log.info "Applying system role '#{role_id}'"
features = raw_roles.find { |r| r["id"] == role_id }
Expand All @@ -192,6 +193,8 @@ def apply_role(role_id)
adapt_services(role_id)
end

# for given role sets in {::Installation::Services} list of services to enable
# according to its config. Do not use alone and use apply_role instead.
def adapt_services(role_id)
services = raw_roles.find { |r| r["id"] == role_id }["services"]
services ||= []
Expand Down
5 changes: 4 additions & 1 deletion src/lib/installation/services.rb
Expand Up @@ -14,11 +14,13 @@ class Services
class << self
include Yast::Logger

# gets array of services to enable
def enabled
@enabled ||= []
@enabled
end

# sets array of services to enable
# @raise [ArgumentError] when argument is not Array
def enabled=(services)
if !services.is_a?(::Array)
raise ArgumentError, "Services#enabled= allows only Array as " \
Expand All @@ -28,6 +30,7 @@ def enabled=(services)
@enabled = services
end

# does real enablement of services previously set
def write
enabled.each do |service|
log.info "Enabling service #{service}"
Expand Down

0 comments on commit 236e6a6

Please sign in to comment.