bin/handler-ansible.rb in sensu-plugins-ansible-0.0.4 vs bin/handler-ansible.rb in sensu-plugins-ansible-1.0.0

- old
+ new

@@ -1,6 +1,8 @@ #! /usr/bin/env ruby +# frozen_string_literal: true + # # handler-ansible.rb # # DESCRIPTION: # This handler runs an Ansible playbook (http://www.ansible.com/) passing the @@ -50,10 +52,10 @@ end command = "#{ansible} -e '#{extra_vars}' #{playbook}" output = `#{command}` - if $CHILD_STATUS.exitstatus > 0 + if $CHILD_STATUS.exitstatus.positive? puts output exit 1 else puts "SUCCESS: #{command}" end