diff options
author | Marc Chamberland <mchamberland@pbsc.com> | 2019-04-14 12:11:53 -0400 |
---|---|---|
committer | Marc Chamberland <chamberland.marc@gmail.com> | 2019-11-04 22:44:15 -0500 |
commit | e8dbf50d7800ac6a53aab9ca2f7b5b1812a6d010 (patch) | |
tree | a651a0ed64deff55964ae2836c1dcdf2e52634ba /ext/win32-eventlog/Rakefile | |
parent | 262026a09745719784d7fc4b140228912307b4de (diff) | |
download | chef-e8dbf50d7800ac6a53aab9ca2f7b5b1812a6d010.tar.gz |
dist constants in win logs
Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com>
Diffstat (limited to 'ext/win32-eventlog/Rakefile')
-rw-r--r-- | ext/win32-eventlog/Rakefile | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/win32-eventlog/Rakefile b/ext/win32-eventlog/Rakefile index a4f032d04e..6f59f096a3 100644 --- a/ext/win32-eventlog/Rakefile +++ b/ext/win32-eventlog/Rakefile @@ -1,6 +1,8 @@ require "rubygems" require "rake" require "mkmf" +require "erb" +require "chef/dist" desc "Building event log dll" @@ -12,6 +14,12 @@ def ensure_present(commands) end end +# Templating the windows event log messages +# So we can inject distro constants in there +template = ERB.new(IO.read("chef-log.man.erb")) +chef_log_man = template.result +File.open("chef-log.man", "w") { |f| f.write(chef_log_man) } + EVT_MC_FILE = "chef-log.man".freeze EVT_RC_FILE = "chef-log.rc".freeze EVT_RESOURCE_OBJECT = "resource.o".freeze @@ -43,7 +51,7 @@ task register: EVT_SHARED_OBJECT do begin Win32::EventLog.add_event_source( source: "Application", - key_name: "Chef", + key_name: Chef::Dist::PRODUCT, event_message_file: dll_file, category_message_file: dll_file ) |