Skip to content

Commit

Permalink
Report error when 2nd stage is disabled (bsc#1046198)
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Jul 4, 2017
1 parent 7f99c07 commit f97f4f9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/modules/DNS.rb
Expand Up @@ -52,6 +52,9 @@ def main
Yast.import "Service"
Yast.import "String"
Yast.import "FileUtils"
Yast.import "Stage"
Yast.import "Mode"
Yast.import "Report"

Yast.include self, "network/routines.rb"
Yast.include self, "network/runtime.rb"
Expand Down Expand Up @@ -479,6 +482,21 @@ def Import(settings)

@nameservers = Builtins.eval(Ops.get_list(settings, "nameservers", []))
@searchlist = Builtins.eval(Ops.get_list(settings, "searchlist", []))

# check for AY unsupported scenarios, the name servers and the search domains
# are written in the 2nd stage, if is disabled then it cannot work (bsc#1046198)
if Stage.initial && Mode.auto && (!@nameservers.empty? || !@searchlist.empty?)
# lazy loading to avoid the dependency on AutoYaST, this can be imported only
# in the initial stage otherwise it might fail!
Yast.import "AutoinstConfig"

if !AutoinstConfig.second_stage
Report.Error(_("DNS configuration error: The name servers or the search domains\n" \
"will not be configured when the second installation stage\n" \
"(after reboot) is disabled in the installation XML profile."))
end
end

@modified = true
# empty settings means that we're probably resetting the config
# thus, setup is not initialized anymore
Expand Down

0 comments on commit f97f4f9

Please sign in to comment.