Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Fixes #21029 - define fail_with_message before run_cmd
Browse files Browse the repository at this point in the history
run_cmd uses fail_with_message, so it has to be defined before
  • Loading branch information
evgeni authored and John Mitsch committed Oct 6, 2017
1 parent 765b640 commit 9407441
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions katello/helper.rb
Expand Up @@ -23,6 +23,12 @@ def disable_system_check_option?
Gem::Version.new(katello_installer_version) >= Gem::Version.new("3.2.0")
end

def fail_with_message(message, opt_parser=nil)
STDOUT.puts message
puts opt_parser if opt_parser
exit(false)
end

def run_cmd(command, exit_codes=[0], message=nil)
result = `#{command}`
unless exit_codes.include?($?.exitstatus)
Expand All @@ -41,11 +47,5 @@ def run_cmd(command, exit_codes=[0], message=nil)
def timestamp
DateTime.now.strftime('%Y%m%d%H%M%S')
end

def fail_with_message(message, opt_parser=nil)
STDOUT.puts message
puts opt_parser if opt_parser
exit(false)
end
end
end

0 comments on commit 9407441

Please sign in to comment.