Skip to content

Commit

Permalink
Fix pull request #127, possible lib loading issues
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenekjanda committed Jan 18, 2014
1 parent 64b37e9 commit 231196f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/puppet/provider/sensu_filter/json.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet.version < '3'
require 'json' if Puppet.features.json?

require 'puppet_x/sensu/to_type'
begin
require 'puppet_x/sensu/to_type'
rescue LoadError => e
libdir = Pathname.new(__FILE__).parent.parent.parent
require File.join(libdir, 'puppet_x/sensu/to_type')
end

Puppet::Type.type(:sensu_filter).provide(:json) do
confine :feature => :json
Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/type/sensu_filter.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
require 'puppet_x/sensu/to_type'
begin
require 'puppet_x/sensu/to_type'
rescue LoadError => e
libdir = Pathname.new(__FILE__).parent.parent.parent
require File.join(libdir, 'puppet_x/sensu/to_type')
end
Puppet::Type.newtype(:sensu_filter) do
@doc = ""

Expand Down

0 comments on commit 231196f

Please sign in to comment.