Commit 5694a00e authored by Douwe Maan's avatar Douwe Maan

Merge branch 'unify-simple_executor' into 'master'

Bring changes from EE for lib/system_check/simple_executor.rb

See merge request gitlab-org/gitlab-ce!19782
parents cc553ed8 5240bb75
...@@ -43,7 +43,7 @@ module SystemCheck ...@@ -43,7 +43,7 @@ module SystemCheck
# #
# @param [SystemCheck::BaseCheck] check_klass # @param [SystemCheck::BaseCheck] check_klass
def run_check(check_klass) def run_check(check_klass)
$stdout.print "#{check_klass.display_name} ... " print_display_name(check_klass)
check = check_klass.new check = check_klass.new
...@@ -60,18 +60,18 @@ module SystemCheck ...@@ -60,18 +60,18 @@ module SystemCheck
end end
if check.check? if check.check?
$stdout.puts check_klass.check_pass.color(:green) print_check_pass(check_klass)
else else
$stdout.puts check_klass.check_fail.color(:red) print_check_failure(check_klass)
if check.can_repair? if check.can_repair?
$stdout.print 'Trying to fix error automatically. ...' $stdout.print 'Trying to fix error automatically. ...'
if check.repair! if check.repair!
$stdout.puts 'Success'.color(:green) print_success
return return
else else
$stdout.puts 'Failed'.color(:red) print_failure
end end
end end
...@@ -83,6 +83,26 @@ module SystemCheck ...@@ -83,6 +83,26 @@ module SystemCheck
private private
def print_display_name(check_klass)
$stdout.print "#{check_klass.display_name} ... "
end
def print_check_pass(check_klass)
$stdout.puts check_klass.check_pass.color(:green)
end
def print_check_failure(check_klass)
$stdout.puts check_klass.check_fail.color(:red)
end
def print_success
$stdout.puts 'Success'.color(:green)
end
def print_failure
$stdout.puts 'Failed'.color(:red)
end
# Prints header content for the series of checks to be executed for this component # Prints header content for the series of checks to be executed for this component
# #
# @param [String] component name of the component relative to the checks being executed # @param [String] component name of the component relative to the checks being executed
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment