summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-03-14 02:05:58 -0700
committerelijah <elijah@riseup.net>2013-03-14 02:05:58 -0700
commita76749a837a2552b72be34d91330f8983f740860 (patch)
treeae392ced56be7dc35b22cbe37713b32deabdf169 /lib
parent2fd87063c0f48b67cb53bba6d52d82a091be6a7b (diff)
added exit codes for puppet apply
Diffstat (limited to 'lib')
-rw-r--r--lib/leap_cli/commands/deploy.rb2
-rw-r--r--lib/leap_cli/logger.rb5
-rw-r--r--lib/leap_cli/util.rb5
3 files changed, 8 insertions, 4 deletions
diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb
index d7f5df8..76df4fb 100644
--- a/lib/leap_cli/commands/deploy.rb
+++ b/lib/leap_cli/commands/deploy.rb
@@ -60,7 +60,7 @@ module LeapCli
else ''
end
- ssh.set :puppet_command, "/usr/bin/puppet apply --color=false --tags=#{tags.join(',')} #{verbosity}"
+ ssh.set :puppet_command, "/usr/bin/puppet apply --color=false --tags=#{tags.join(',')} --detailed-exitcodes #{verbosity}"
ssh.set :puppet_lib, "puppet/modules"
ssh.set :puppet_parameters, '--libdir puppet/lib --confdir puppet puppet/manifests/site.pp'
ssh.set :puppet_stream_output, true
diff --git a/lib/leap_cli/logger.rb b/lib/leap_cli/logger.rb
index 58aa3c0..e700ee6 100644
--- a/lib/leap_cli/logger.rb
+++ b/lib/leap_cli/logger.rb
@@ -121,6 +121,8 @@ module LeapCli
{ :match => /^warning:/, :level => 0, :color => :yellow, :priority => -20},
{ :match => /^Duplicate declaration:/, :level => 0, :color => :red, :priority => -20},
{ :match => /Finished catalog run/, :level => 0, :color => :green, :priority => -10},
+ { :match => /^Puppet apply complete \(changes made\)/, :level => 0, :color => :green, :priority => -10},
+ { :match => /^Puppet apply complete \(no changes\)/, :level => 0, :color => :green, :priority => -10},
# PUPPET FATAL ERRORS
{ :match => /^err:/, :level => 0, :color => :red, :priority => -1, :exit => 1},
@@ -128,7 +130,8 @@ module LeapCli
{ :match => /^Parameter matches failed:/, :level => 0, :color => :red, :priority => -1, :exit => 1},
{ :match => /^Syntax error/, :level => 0, :color => :red, :priority => -1, :exit => 1},
{ :match => /^Cannot reassign variable/, :level => 0, :color => :red, :priority => -1, :exit => 1},
- { :match => /^Could not find template/, :level => 0, :color => :red, :priority => -1, :exit => 1}
+ { :match => /^Could not find template/, :level => 0, :color => :red, :priority => -1, :exit => 1},
+ { :match => /^Puppet apply complete.*fail/, :level => 0, :color => :red, :priority => -1, :exit => 1}
]
def self.sorted_formatters
diff --git a/lib/leap_cli/util.rb b/lib/leap_cli/util.rb
index 155796f..0453b6d 100644
--- a/lib/leap_cli/util.rb
+++ b/lib/leap_cli/util.rb
@@ -12,8 +12,9 @@ module LeapCli
## QUITTING
##
- def exit_status(code)
- @exit_status = code
+ def exit_status(code=nil)
+ @exit_status = code if code
+ @exit_status
end
#