aboutsummaryrefslogtreecommitdiffstats
path: root/modules/report-socket/lib/puppet/reports/socket.rb
diff options
context:
space:
mode:
Diffstat (limited to 'modules/report-socket/lib/puppet/reports/socket.rb')
-rw-r--r--modules/report-socket/lib/puppet/reports/socket.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/report-socket/lib/puppet/reports/socket.rb b/modules/report-socket/lib/puppet/reports/socket.rb
index f682cb98..b1af057d 100644
--- a/modules/report-socket/lib/puppet/reports/socket.rb
+++ b/modules/report-socket/lib/puppet/reports/socket.rb
@@ -7,11 +7,16 @@ end
Puppet::Reports.register_report(:socket) do
configfile = File.join([File.dirname(Puppet.settings[:config]), "socket.yaml"])
- raise(Puppet::ParseError, "Socket report config file #{configfile} not readable") unless File.exist?(configfile)
+ # do not raise a error since this will show in puppet log
+ # raise(Puppet::ParseError, "Socket report config file #{configfile} not readable") unless
+ if File.exist?(configfile)
- config = YAML.load_file(configfile)
- SOCKET_PATH = config[:socket_path]
- # TODO add support for using another user ?
+ # TODO add support for using another user ?
+ config = YAML.load_file(configfile)
+ SOCKET_PATH = config[:socket_path]
+ else
+ SOCKET_PATH = nil
+ end
desc <<-DESC
Send notification of failed reports to a socket.