Skip to content

Commit

Permalink
Fix sensu_license error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Apr 15, 2020
1 parent 7622328 commit 191eeca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/sensu_license/sensuctl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ def initialize(value = {})

def create
begin
sensuctl(['create','-f',resource[:file]])
output = sensuctl(['create','-f',resource[:file]])
rescue Puppet::ExecutionFailure => e
raise Puppet::Error, "sensuctl create failed\nOutput: #{output}\nError message: #{e.message}"
end
end

def destroy
begin
sensuctl(['delete','-f',resource[:file]])
output = sensuctl(['delete','-f',resource[:file]])
rescue Puppet::ExecutionFailure => e
raise Puppet::Error, "sensuctl create failed\nOutput: #{output}\nError message: #{e.message}"
end
Expand Down

0 comments on commit 191eeca

Please sign in to comment.