Commit 3018ce1 1 parent 60af17a commit 3018ce1 Copy full SHA for 3018ce1
File tree 9 files changed +33
-16
lines changed
9 files changed +33
-16
lines changed Original file line number Diff line number Diff line change
1
+ Puppet . features . add ( :json , :libs => [ "json" ] )
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_api_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
# Internal: Retrieve the current contents of /etc/sensu/config.json.
6
8
#
7
9
# Returns a Hash representation of the JSON structure in
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_check_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def initialize ( *args )
6
8
super
7
9
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_clean_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def conf
6
8
begin
7
9
@conf ||= JSON . parse ( File . read ( '/etc/sensu/config.json' ) )
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_client_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def initialize ( *args )
6
8
super
7
9
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_dashboard_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def conf
6
8
begin
7
9
@conf ||= JSON . parse ( File . read ( '/etc/sensu/config.json' ) )
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_handler_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def initialize ( *args )
6
8
super
7
9
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_rabbitmq_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def conf
6
8
begin
7
9
@conf ||= JSON . parse ( File . read ( '/etc/sensu/config.json' ) )
Original file line number Diff line number Diff line change 1
- require 'rubygems' if RUBY_VERSION < '1.9.0'
2
- require 'json'
1
+ require 'rubygems' if RUBY_VERSION < '1.9.0' && Puppet . features . rubygems?
2
+ require 'json' if Puppet . features . json?
3
3
4
4
Puppet ::Type . type ( :sensu_redis_config ) . provide ( :json ) do
5
+ confine :feature => :json
6
+
5
7
def conf
6
8
begin
7
9
@conf ||= JSON . parse ( File . read ( '/etc/sensu/config.json' ) )
You can’t perform that action at this time.
0 commit comments