summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-11-10 10:46:39 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2014-11-10 10:46:39 -0800
commitb7b72b34d5f2c4a7e08fdb412ab603b211dfca7d (patch)
tree90063d09d3c3f356b3ee19117011b66aedd047cb
parentf8df84e6748e7dd71343fd7844255aa37dbfab78 (diff)
downloadchef-b7b72b34d5f2c4a7e08fdb412ab603b211dfca7d.tar.gz
Windows event logger no longer imports into the global namespace.
This was causing problems with the windows cookbook trying to redefine one of those constants. This patch solves https://github.com/opscode-cookbooks/windows/issues/141
-rw-r--r--lib/chef/event_loggers/windows_eventlog.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/chef/event_loggers/windows_eventlog.rb b/lib/chef/event_loggers/windows_eventlog.rb
index b8d279594b..6d45d4fab4 100644
--- a/lib/chef/event_loggers/windows_eventlog.rb
+++ b/lib/chef/event_loggers/windows_eventlog.rb
@@ -26,7 +26,6 @@ if Chef::Platform::windows? and not Chef::Platform::windows_server_2003?
end
require 'win32/eventlog'
- include Win32
end
class Chef
@@ -51,12 +50,12 @@ class Chef
end
def initialize
- @eventlog = EventLog::open('Application')
+ @eventlog = ::Win32::EventLog::open('Application')
end
def run_start(version)
@eventlog.report_event(
- :event_type => EventLog::INFO_TYPE,
+ :event_type => ::Win32::EventLog::INFO_TYPE,
:source => SOURCE,
:event_id => RUN_START_EVENT_ID,
:data => [version]
@@ -66,7 +65,7 @@ class Chef
def run_started(run_status)
@run_status = run_status
@eventlog.report_event(
- :event_type => EventLog::INFO_TYPE,
+ :event_type => ::Win32::EventLog::INFO_TYPE,
:source => SOURCE,
:event_id => RUN_STARTED_EVENT_ID,
:data => [run_status.run_id]
@@ -75,7 +74,7 @@ class Chef
def run_completed(node)
@eventlog.report_event(
- :event_type => EventLog::INFO_TYPE,
+ :event_type => ::Win32::EventLog::INFO_TYPE,
:source => SOURCE,
:event_id => RUN_COMPLETED_EVENT_ID,
:data => [@run_status.run_id, @run_status.elapsed_time.to_s]
@@ -88,7 +87,7 @@ class Chef
#Exception backtrace: %5
def run_failed(e)
@eventlog.report_event(
- :event_type => EventLog::ERROR_TYPE,
+ :event_type => ::Win32::EventLog::ERROR_TYPE,
:source => SOURCE,
:event_id => RUN_FAILED_EVENT_ID,
:data => [@run_status.run_id,