Skip to content

Commit

Permalink
allow for the chef gem installation to succeed even without elevated …
Browse files Browse the repository at this point in the history
…privileges, skip the event log registration in this case
  • Loading branch information
tknerr authored and btm committed Mar 27, 2015
1 parent 8bb31f9 commit 8aa3200
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions ext/win32-eventlog/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ end
task :register => EVT_SHARED_OBJECT do
require 'win32/eventlog'
dll_file = File.expand_path(EVT_SHARED_OBJECT)
Win32::EventLog.add_event_source(
:source => "Application",
:key_name => "Chef",
:event_message_file => dll_file,
:category_message_file => dll_file
)
begin
Win32::EventLog.add_event_source(
:source => "Application",
:key_name => "Chef",
:event_message_file => dll_file,
:category_message_file => dll_file
)
rescue Errno::EIO => e
puts "Skipping event log registration due to missing privileges: #{e}"
end
end

0 comments on commit 8aa3200

Please sign in to comment.