Skip to content

Commit

Permalink
Merge pull request #88 from rightscale/OPS-3261_skip_interactive_prom…
Browse files Browse the repository at this point in the history
…pts_in_non_interactive_scenarios

OPS-3261 skip interactive prompt in automation
  • Loading branch information
Marc committed Aug 23, 2016
2 parents c7b5fb4 + f03636c commit 650cb38
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,7 @@ Version 2.1.20
Version 2.1.21
--------------
* Bugfix: Pull the correct path whenever loading up the erb template in webui.

Version 2.1.22
--------------
* Bugfix: use 'pause' behaviour if there are no contents in stdin
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
right_chimp (2.1.21)
right_chimp (2.1.22)
highline (~> 1.7.2)
nokogiri (~> 1.6.7.1)
progressbar (~> 0.11.0)
Expand Down
9 changes: 9 additions & 0 deletions lib/right_chimp/Chimp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,15 @@ def verify_results(group = :default)
puts "(A)bort chimp run"
puts "(I)gnore errors and continue"
command = gets()
if command.nil?
#
# if command is nil, stdin is closed or its source ended
# probably because we are in an automated environment,
# then we pause like in '--no-prompt' scenario
#
puts 'Warning! stdin empty, using pause behaviour, use --no-prompt to avoid this message'
return 'pause'
end

if command =~ /^a/i
puts "Aborting!"
Expand Down
2 changes: 1 addition & 1 deletion lib/right_chimp/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Chimp
VERSION = "2.1.21"
VERSION = "2.1.22"
end

0 comments on commit 650cb38

Please sign in to comment.