From ad8629a430cd9b452081aca8ea50ef6d5efa4f8d Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Tue, 11 Jul 2017 17:42:07 +0000 Subject: [PATCH] Fixes #20277 - Adds -y flag to katello-hostname-change --- katello/katello-change-hostname | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/katello/katello-change-hostname b/katello/katello-change-hostname index 064a4a01..1d4a5eb1 100755 --- a/katello/katello-change-hostname +++ b/katello/katello-change-hostname @@ -67,6 +67,10 @@ opt_parser = OptionParser.new do |opt| end end + opt.on("-y", "--assumeyes", "Bypass interaction by answering yes") do |confirm| + @options[:confirm] = confirm + end + if @foreman_proxy_content opt.on("-c", "--certs-tar CERTS_TAR", @@ -199,8 +203,12 @@ def precheck(response) end end -STDOUT.print(warning_message) -response = yesno +if @options[:confirm] + response = true +else + STDOUT.print(warning_message) + response = yesno +end precheck(response) if @foreman_proxy_content